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:
- Activated the virtual environment:
venv\Scripts\activate
- Installed Celery:
pip install celery
- Verified Celery installation:
pip show celery
Output:
Name: celery Version: 5.3.4
- Checked for
celery.exe
:
dir venv\Scripts\celery*
celery.exe is present in the Scripts folder.
- Tried running Celery directly:
celery -A saas_monitor worker --loglevel=info -P gevent
Error:
‘celery’ is not recognized as an internal or external command
- 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
- Recreated the virtual environment:
- Deleted the
venv
folder and created a new one. - Reinstalled all dependencies, including Celery.
- 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.