I use instructions described here. Python 2.7 and Celery 3.1.17.
In celery.py I have (in beginning):
from __future__ import absolute_import
import os
from celery import Celery
from django.conf import settings
When I run:
celery -A proj worker -l info
I have an error:
from django.conf import settings
ImportError: No module named 'django'
But I have Django and my project works.
How to fix that?
Thanks!
Make sure that you are running
celery
with yourvirtualenv
. The way to check this is with yourvirtualenv
activated, run the command:If you see something like:
Then you have
celery
installed globally, and you need to uninstall it, and make sure it's only in yourvirtualenv
.After uninstalling
celery
globally, within thevirtualenv
runwhich celery
again and check.