I am following the Celery Documentation v:latest
I installed all the dependencies and my celery version is 3.0.11
I made a file tasks.py and pasted the code:
from celery import Celery
app = Celery('tasks', broker='amqp://guest@localhost//')
@app.task
def add(x, y):
return x + y
When I run the very Next command in the same directory:
celery -A tasks worker --loglevel=info
I get this error `AttributeError: 'module' object has no attribute 'celery'
I got few similar question but that did not helped me ... Do any one has any idea ? Here is the TraceBack...
Traceback (most recent call last):
File "/home/nishant-un/env/bin/celery", line 9, in <module>
load_entry_point('celery==3.0.11', 'console_scripts', 'celery')()
File "/home/nishant-un/env/local/lib/python2.7/site-packages/celery/__main__.py", line 14, in main
main()
File "/home/nishant-un/env/local/lib/python2.7/site-packages/celery/bin/celery.py", line 946, in main
cmd.execute_from_commandline(argv)
File "/home/nishant-un/env/local/lib/python2.7/site-packages/celery/bin/celery.py", line 890, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "/home/nishant-un/env/local/lib/python2.7/site-packages/celery/bin/base.py", line 177, in execute_from_commandline
argv = self.setup_app_from_commandline(argv)
File "/home/nishant-un/env/local/lib/python2.7/site-packages/celery/bin/base.py", line 295, in setup_app_from_commandline
self.app = self.find_app(app)
File "/home/nishant-un/env/local/lib/python2.7/site-packages/celery/bin/base.py", line 313, in find_app
return sym.celery
AttributeError: 'module' object has no attribute 'celery'
AttributeError? Could you provide a full traceback please?-A tasks:appThis means the same asfrom tasks import appin a python module, and tells the celery command where to find the instance to use, the shortcut form did not work like this in the version you are using (3.0.11)