Celery not working: 'celery' is not recognized as an internal or external command

I’m trying to run Celery in my Django project, but I’m encountering the following error:

‘celery’ is not recognized as an internal or external command

I’ve tried the following steps to resolve the issue, but nothing has worked so far:

  1. Activated the virtual environment:

venv\Scripts\activate

  1. Installed Celery:

pip install celery

  1. Verified Celery installation:

pip show celery

Output:

Name: celery Version: 5.3.4

  1. Checked for celery.exe:

dir venv\Scripts\celery*

celery.exe is present in the Scripts folder.

  1. Tried running Celery directly:

celery -A saas_monitor worker --loglevel=info -P gevent

Error:
‘celery’ is not recognized as an internal or external command

  1. Tried running Celery using Python’s -m option:
    python -m celery -A saas_monitor worker --loglevel=info -P gevent

Error:
C:\Users\hp\AppData\Local\Programs\Python\Python311\python.exe: can’t open file ‘F:\Ideas\SAAS\Websiteisup\code\websiteisup\backend\celery’: [Errno 2] No such file or directory

  1. Recreated the virtual environment:
  • Deleted the venv folder and created a new one.
  • Reinstalled all dependencies, including Celery.
  1. Added the virtual environment’s Scripts folder to the system PATH:
  • Confirmed that venv\Scripts is in the PATH.

Despite all these steps, the issue persists.

https://docs.celeryq.dev/en/stable/faq.html#windows

Does Celery support Windows?

Answer: No.

Since Celery 4.x, Windows is no longer supported due to lack of resources.

But it may still work and we are happy to accept patches.

Thanks a lot @JamesParrott you saved my time by answering it. Can you please tell me what alternative should I use?

You’re welcome.

The choice of alternative depends on what functionality Celery is needed for? It’s overkill just for scheduling, for example.

Where are you planning to deploy Django to, in production, too? If a Linux production server is needed anyway, and it could well be easier to just replicate that, than to configure Django, the DB, and Celery. just for local development on Windows.

Thanks a lot, I had the same problem.