I went through this example here:
http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
All my tasks are in files called tasks.py.
For someone who want to know what cause this error:
I have meet this problem just now, then I found the problem --- sys.path.
Maybe you add some path to sys.path like me, I add below code in manage.py,
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
SRC_PATH = os.path.join(ROOT_PATH, 'src')
CONF_PATH = os.path.join(ROOT_PATH, 'conf')
sys.path.insert(0, SRC_PATH)
sys.path.insert(0, CONF_PATH)
so, from celery import Celery
would search celery in SRC_PATH
and CONF_PATH
first, that's the problem.
change to
sys.path.append(SRC_PATH)
sys.path.append(CONF_PATH)
It would search in python's lib
and site-packages
first. Solved perfectly.