0

I have an issue trying to setup Celery on Django I'm using django example app

I setup virtualenv using following commands

pip install virtualenv
virtualenv ..\env
call ..\env\Scripts\activate
pip install celery
pip install django

which gives me following environment

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

and after trying to start worker by command

$ celery -A proj worker -l info

I'm ending up with runtime error

File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
  File "C:\Python27\Lib\functools.py", line 56, in <lambda>
    '__lt__': [('__gt__', lambda self, other: other < self),
RuntimeError: maximum recursion depth exceeded while calling a Python object

Do you have an idea what I'm doing wrong?

Zgr3doo
  • 1,765
  • 17
  • 20
  • 1
    Please refer to this answer - http://stackoverflow.com/a/21834988/5121725 – anonDuck Mar 29 '16 at 13:44
  • @RA123 thanks for your quick answer it points me to the correct direction I had python 2.7.2 which was obsolete I updated it to python 2.7.11 which is most recent at the moment and it works. If you can create answer I will accept it because you was first Thanks. – Zgr3doo Mar 29 '16 at 14:33

1 Answers1

2

The problem is in functools.py file.
To fix the problem replace convert dictionary in file functools.py(about line 56 in python\Lib\functools.py):

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)]
}

to that values

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)]
}
Harun ERGUL
  • 5,770
  • 5
  • 53
  • 62