我在Django上安装Celery时遇到问题,我正在使用Django示例应用
我使用以下命令设置virtualenv
pip install virtualenv
virtualenv ..env
call ..envScriptsactivate
pip install celery
pip install django
这给了我以下环境
amqp==1.4.9
anyjson==0.3.3
billiard==3.3.0.23
celery==3.1.23
Django==1.9.4
kombu==3.0.35
pytz==2016.3
并且在尝试通过命令启动工作程序之后
$ celery -A proj worker -l info
我最终出现运行时错误
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
File "C:Python27Libfunctools.py", line 56, in <lambda>
'__lt__': [('__gt__', lambda self, other: other < self),
RuntimeError: maximum recursion depth exceeded while calling a Python object
你知道我做错了什么吗?
问题出现在functools.py文件中
要解决此问题,请替换文件functools.py中的convert dictionary(关于python\Lib\functools.py中的第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)]
}