我跟着芹菜教程Celery一步一步,按照芹菜樣品步驟,總是給我進口芹菜錯誤
但是經過我執行命令:celery -A tasks worker --loglevel=info
,它總是給我一個錯誤。
這裏是堆棧:
File "/usr/local/bin/celery", line 9, in <module>
load_entry_point('celery==3.0.24', 'console_scripts', 'celery')()
File "/usr/local/lib/python2.7/dist-packages/celery-3.0.24-py2.7.egg/celery/__main__.py", line 14, in main
main()
File "/usr/local/lib/python2.7/dist-packages/celery-3.0.24-py2.7.egg/celery/bin/celery.py", line 957, in main
cmd.execute_from_commandline(argv)
File "/usr/local/lib/python2.7/dist-packages/celery-3.0.24-py2.7.egg/celery/bin/celery.py", line 901, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "/usr/local/lib/python2.7/dist-packages/celery-3.0.24-py2.7.egg/celery/bin/base.py", line 185, in execute_from_commandline
argv = self.setup_app_from_commandline(argv)
File "/usr/local/lib/python2.7/dist-packages/celery-3.0.24-py2.7.egg/celery/bin/base.py", line 300, in setup_app_from_commandline
self.app = self.find_app(app)
File "/usr/local/lib/python2.7/dist-packages/celery-3.0.24-py2.7.egg/celery/bin/base.py", line 318, in find_app
return sym.celery
AttributeError: 'module' object has no attribute 'celery'
的tasks.py只是跟着樣品,不同的是我使用的Redis的經紀人......
from celery import Celery
app = Celery('tasks', broker='redis://localhost:6379//0')
@app.task
def add(x, y):
return x + y
我真的沒有想法這個問題背後是什麼,你能解釋一下嗎?
謝謝你的回答,但它仍然無法工作:( – liuzhidong 2014-10-17 23:17:25