Registry / workflow / celery

celery

JSON →
library5.6.2pypypi✓ verified 50d ago

Distributed task queue for Python. Current version is 5.6.2 (Jan 2026). Requires Python >=3.9. A broker (Redis or RabbitMQ) is always required — there is no built-in broker. Old lowercase config settings (CELERY_TASK_SERIALIZER etc.) removed in Celery 5.0. SQS transport: pycurl→urllib3 in 5.5, then reverted in 5.6 — SQS users need pycurl reinstalled after 5.5→5.6 upgrade. Security fix: broker URL passwords were logged in plaintext before 5.6.

workflowdatabase
pip install celery
Install & Compatibility
Where this runs
tested against v5.6.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
15/20 runs
✓ 4.08s
py 3.11
15/20 runs
✓ 4.19s
py 3.12
15/20 runs
✓ 3.77s
py 3.13
15/20 runs
✓ 3.66s
py 3.9
15/20 runs
✓ 4.68s
84MB installed
● package 84MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Celery
from celery import Celery
from celery import Celery

Requires Redis running. Start worker in separate terminal: celery -A tasks worker --loglevel=info

# tasks.py from celery import Celery app = Celery( 'tasks', broker='redis://localhost:6379/0', backend='redis://localhost:6379/0' ) app.conf.update( task_serializer='json', accept_content=['json'], result_serializer='json', timezone='UTC', ) @app.task def add(x, y): return x + y @app.task(bind=True, max_retries=3) def fetch_data(self, url): try: import requests return requests.get(url).json() except Exception as exc: raise self.retry(exc=exc, countdown=5) # --- Run worker --- # celery -A tasks worker --loglevel=info # --- Call from client --- # result = add.delay(4, 6) # print(result.get(timeout=10)) # 10
celery --version
Debug
Known issues
breakingAll old uppercase CELERY_* config keys (CELERY_BROKER_URL, CELERY_RESULT_BACKEND, CELERY_TASK_SERIALIZER, etc.) were deprecated in Celery 4.0 and removed in Celery 5.0. Using them silently does nothing or raises errors.
fix
Replace all CELERY_* uppercase keys with lowercase equivalents: CELERY_BROKER_URL → broker_url, CELERY_RESULT_BACKEND → result_backend, CELERY_TASK_SERIALIZER → task_serializer. See the Celery 4.0 migration guide.
affects: >= 5.0
breakingPython 3.8 support dropped in Celery 5.6.0. Minimum is now Python 3.9.
fix
Pin celery<5.6 for Python 3.8 environments.
affects: >= 5.6
breakingSQS transport: pycurl was replaced by urllib3 in Celery 5.5, then reverted back to pycurl in 5.6 due to critical issues. Users who uninstalled pycurl after upgrading to 5.5 must reinstall it before upgrading to 5.6. Note: 'pycurl' often requires system-level development headers (e.g., libcurl-dev or curl-devel) to be installed before 'pip install pycurl' can succeed.
fix
Ensure libcurl development headers are installed before pip installing pycurl. For Alpine-based environments (like python:3.13-alpine), this means running 'apk add curl-dev'. Then, pip install pycurl before upgrading to celery 5.6 if you use the SQS transport.
affects: 5.5 → 5.6 upgrade
breakingSecurity: broker URLs containing passwords were logged in plaintext by the delayed delivery mechanism before 5.6. Credentials visible in log files.
fix
Upgrade to celery>=5.6.0. Audit existing logs for exposed credentials.
affects: < 5.6
gotchaCelery requires a broker — there is no built-in broker. Without a running Redis or RabbitMQ instance, all .delay() and .apply_async() calls raise kombu.exceptions.OperationalError.
fix
Start Redis locally: docker run -d -p 6379:6379 redis. Then set broker='redis://localhost:6379/0' in your Celery app.
affects: all
gotchaThe result backend is separate from the broker. Without a configured result_backend, result.get() blocks forever or raises NotImplementedError. Many tutorials configure the broker but forget the backend.
fix
Set backend= in Celery() constructor or result_backend in app.conf. For Redis: backend='redis://localhost:6379/0'.
affects: all
gotchaTask serializer defaults to json in Celery 5.x. Using pickle=True or passing non-JSON-serializable objects to tasks raises kombu.exceptions.EncodeError. Complex Python objects (datetime, custom classes) must be serialized manually.
fix
Convert task arguments to JSON-serializable types before calling .delay(). For datetime: pass .isoformat() string, parse inside the task.
affects: >= 5.0
gotchaIn notebooks and scripts using multiprocessing, Accelerator() or notebook_launcher patterns: the Celery app must be importable as a module — it cannot be defined inline in a __main__ block. Workers import the app from the module path passed to -A.
fix
Define the Celery app in a separate module file (e.g. tasks.py). Start worker with: celery -A tasks worker
affects: all
Upgrade
Version history
5.6.3latest on PyPI
Audit
Dependencies
kombu>=5.3.0requiredRequired. Message transport abstraction. Installed automatically.
billiard>=4.2.0requiredRequired. Multiprocessing fork. Installed automatically.
click>=8.1.2requiredRequired. CLI framework. Installed automatically.
redis>=4.5.2optionalRequired for Redis broker/backend. Install via celery[redis].
pycurloptionalRequired for SQS transport in Celery 5.6+. Was replaced by urllib3 in 5.5 then reverted — must reinstall manually if upgrading from 5.5.
Agent activity
69 hits · last 30 days
node
12
seranking-bot
4
ahrefsbot
2
bytedance
2
Amazon
1
bingbot
1
amazonbot
1
Resources