How to Install celery in Python
Distributed Task Queue.
pip install celery
What is celery?
Distributed Task Queue.
:Web: :Download: :Source: :DeepWiki: |deepwiki| :Keywords: task, queue, job, async, rabbitmq, amqp, redis, python, distributed, actors
is our community-powered funding platform that fuels Celery's ongoing development. Your sponsorship directly supports improvements, maintenance, and innovative features that keep Celery robust and reliable.
Available as part of the Tidelift Subscription.
Quick Start
Minimal example to get started with celery:
from celery import Celery
app = Celery("tasks", broker="redis://localhost:6379/0")
@app.task
def add(x, y):
return x + y
# Call the task asynchronously
result = add.delay(4, 6)
print(result.get()) # 10
# Start worker: celery -A tasks worker --loglevel=info
Installation
pip (standard)
pip install celery
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install celery
pip3
pip3 install celery
conda
conda install -c conda-forge celery
Poetry
poetry add celery
Dependencies
Installing celery will also install these packages:
Verify the Installation
After installing, confirm the package is available:
python -c "import celery; print(celery.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing celery with pip.
ModuleNotFoundError: No module named 'celery'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install celery. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'celery' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install celery to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'celery'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show celery and upgrade with pip install --upgrade celery.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install celery. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user celery
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org celery
Runtime Errors
Common errors when using celery after installation.
kombu.exceptions.OperationalError: Connection refused
Cause: The message broker (Redis or RabbitMQ) is not running.
Fix: Start the broker: redis-server. Check the broker URL in your Celery config.
celery.exceptions.NotRegistered: task_name
Cause: The task module was not imported before the worker started.
Fix: Use app.autodiscover_tasks(['myapp']) or import task modules explicitly in celery.py.
Recent Releases
| Version | Released |
|---|---|
5.6.3 latest |
2026-03-26 |
5.6.2 |
2026-01-04 |
5.6.1 |
2025-12-29 |
5.6.0 |
2025-11-30 |
5.6.0rc2 |
2025-11-22 |
Manage celery
Upgrade to latest version
pip install --upgrade celery
Install a specific version
pip install celery==5.6.3
Uninstall
pip uninstall celery
Check what is installed
pip show celery