[Fixed]-Django and Celery – ModuleNotFoundError: No module named 'celery.task'

19👍

The "task" is no longer in version 5.x
You can use version 4.x

  • pip3 uninstall celery
  • pip3 install celery==4.4.2

Edited the spaces

5👍

They deprecated that functionality as I understood from this issue: https://github.com/celery/celery/issues/6406

Now it seems to be that you need to use this to make scheduled tasks:

https://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html?highlight=periodic

0👍

I encountered this but I used this import below with celery==5.2.7

from celery.schedules import crontab

👤iChux

Leave a comment