Celery worker "Unable to load celery application" in CI
The celery CLI could not import the application you pointed it at with -A. Either the module path is wrong, it isn’t on sys.path, or importing it raises - so the worker never starts.
What this error means
Running celery -A proj worker (or beat) in CI exits with Error: Unable to load celery application. The module proj was not found or a traceback from inside the app module. The worker process doesn’t come up.
Error:
Unable to load celery application.
The module proj.celery was not found.
# or
Unable to load celery application.
While trying to load the module proj.celery the following error occurred:
ModuleNotFoundError: No module named 'config'Common causes
Wrong -A application path
The -A proj or -A proj.celery:app target doesn’t match where the Celery app object actually lives, so the CLI can’t find it.
Module not importable / errors at import
The project isn’t installed (sys.path doesn’t include it) or the app module raises at import - a missing settings module, env var, or broker URL.
How to fix it
Verify the app import and target
Import the Celery app directly to confirm the path before starting the worker.
python -c "from proj.celery import app; print(app)"
celery -A proj.celery:app worker --loglevel=infoMake the project importable in CI
- Run from the repo root or
pip install -e .so the app module is onsys.path. - Set required env (
DJANGO_SETTINGS_MODULE, broker URL) the app reads at import. - Match the
-Atarget to the actualmodule:attributeof the app object.
How to prevent it
- Use an explicit
-A module:apptarget and verify it with a direct import. - Install the project (editable) so Celery can import it from any directory.
- Provide broker/settings env vars in CI before starting the worker.