zoukankan      html  css  js  c++  java
  • python+pycharm+Django报错

    报错:

    Unhandled exception in thread started by <function wrapper at 0x2d7e410>
    Traceback (most recent call last):
      File "/root/virtual_dir/wxwebapp_court_nositepkg/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
        fn(*args, **kwargs)
       .......................省略N多行
      File "/usr/local/lib/python2.7/functools.py", line 56, in <lambda>
        '__lt__': [('__gt__', lambda self, other: other < self),
      .......................省略N多行,重复报上面的错
    RuntimeError: maximum recursion depth exceeded in cmp
     
    解决办法:在python目录中的Lib下面找到functools将56行
    convert = {
            '__lt__': [('__gt__', lambda self, other: other < self),
                       ('__le__', lambda self, other: not other < self),
                       ('__ge__', lambda self, other: not self < other)],
            '__le__': [('__ge__', lambda self, other: other <= self),
                       ('__lt__', lambda self, other: not other <= self),
                       ('__gt__', lambda self, other: not self <= other)],
            '__gt__': [('__lt__', lambda self, other: other > self),
                       ('__ge__', lambda self, other: not other > self),
                       ('__le__', lambda self, other: not self > other)],
            '__ge__': [('__le__', lambda self, other: other >= self),
                       ('__gt__', lambda self, other: not other >= self),
                       ('__lt__', lambda self, other: not self >= other)]
        }
     
    修改成:
    convert = {
            '__lt__': [('__gt__', lambda self, other: not (self < other or self == other)),
                       ('__le__', lambda self, other: self < other or self == other),
                       ('__ge__', lambda self, other: not self < other)],
            '__le__': [('__ge__', lambda self, other: not self <= other or self == other),
                       ('__lt__', lambda self, other: self <= other and not self == other),
                       ('__gt__', lambda self, other: not self <= other)],
            '__gt__': [('__lt__', lambda self, other: not (self > other or self == other)),
                       ('__ge__', lambda self, other: self > other or self == other),
                       ('__le__', lambda self, other: not self > other)],
            '__ge__ ': [('__le__', lambda self, other: (not self >= other) or self == other),
                       ('__gt__', lambda self, other: self >= other and not self == other),
                       ('__lt__', lambda self, other: not self >= other)]
        }
    解决!
  • 相关阅读:
    利用Mathematica计算伴随矩阵
    一个游戏
    华南理工大学2016年数学分析高等代数考研试题参考解答
    中山大学2016年数学分析高等代数考研试题参考解答及其讲解
    张祖锦第7卷第483期一个对数-平方根不等式
    为新生儿办理户口
    丘成桐大学生数学竞赛2014年分析与方程个人赛试题第一题另解
    家里蹲大学数学杂志第7卷第481期一道实分析题目参考解答
    顶级俄国数学家是怎样炼成的?[2016-06-25 张羿 赛先生]
    Calculations are rather interesting
  • 原文地址:https://www.cnblogs.com/myparadiseworld/p/6961338.html
Copyright © 2011-2022 走看看