I am trying to follow the example in the document “First Steps with Celery”. I installed celery using pip.
I created a file called tasks.py in ~ / python / celery and it contains the following:
from celery import Celery celery = Celery('tasks', broker='amqp:// guest@localhost //') @celery.task def add(x, y): return x + y
I started using celery -A tasks worker -loglevel = info in the ~ / python / celery directory and it seems to work.
In a separate terminal window, I started Python and did the following:
from tasks import add add.delay(4, 4)
I get an error: File "/Library/Python/2.7/site-packages/celery/utils/timeutils.py", line 17, in from dateutil import tz ImportError: there is no module named dateutil
How to install dateutils? It is listed as an installed module when I type "pip freeze"
Thanks!
source share