{"id":231,"library":"celery","title":"Celery","description":"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.","status":"active","version":"5.6.2","language":"python","source_language":"en","source_url":"https://docs.celeryq.dev/en/stable/","tags":["task-queue","distributed","async","redis","rabbitmq","workers","scheduling"],"install":[{"cmd":"pip install celery","lang":"bash","label":"Core (no broker included)"},{"cmd":"pip install celery[redis]","lang":"bash","label":"With Redis broker/backend support"},{"cmd":"pip install celery[rabbitmq]","lang":"bash","label":"With RabbitMQ (librabbitmq) support"},{"cmd":"pip install celery[sqs]","lang":"bash","label":"With AWS SQS transport"}],"dependencies":[{"reason":"Required. Message transport abstraction. Installed automatically.","package":"kombu>=5.3.0","optional":false},{"reason":"Required. Multiprocessing fork. Installed automatically.","package":"billiard>=4.2.0","optional":false},{"reason":"Required. CLI framework. Installed automatically.","package":"click>=8.1.2","optional":false},{"reason":"Required for Redis broker/backend. Install via celery[redis].","package":"redis>=4.5.2","optional":true},{"reason":"Required for SQS transport in Celery 5.6+. Was replaced by urllib3 in 5.5 then reverted — must reinstall manually if upgrading from 5.5.","package":"pycurl","optional":true}],"imports":[{"wrong":"from celery import Celery","symbol":"Celery","correct":"from celery import Celery"}],"quickstart":{"code":"# tasks.py\nfrom celery import Celery\n\napp = Celery(\n    'tasks',\n    broker='redis://localhost:6379/0',\n    backend='redis://localhost:6379/0'\n)\n\napp.conf.update(\n    task_serializer='json',\n    accept_content=['json'],\n    result_serializer='json',\n    timezone='UTC',\n)\n\n@app.task\ndef add(x, y):\n    return x + y\n\n@app.task(bind=True, max_retries=3)\ndef fetch_data(self, url):\n    try:\n        import requests\n        return requests.get(url).json()\n    except Exception as exc:\n        raise self.retry(exc=exc, countdown=5)\n\n# --- Run worker ---\n# celery -A tasks worker --loglevel=info\n\n# --- Call from client ---\n# result = add.delay(4, 6)\n# print(result.get(timeout=10))  # 10","lang":"python","description":"Requires Redis running. Start worker in separate terminal: celery -A tasks worker --loglevel=info"},"warnings":[{"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.","message":"All 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.","severity":"breaking","affected_versions":">= 5.0"},{"fix":"Pin celery<5.6 for Python 3.8 environments.","message":"Python 3.8 support dropped in Celery 5.6.0. Minimum is now Python 3.9.","severity":"breaking","affected_versions":">= 5.6"},{"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.","message":"SQS 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.","severity":"breaking","affected_versions":"5.5 → 5.6 upgrade"},{"fix":"Upgrade to celery>=5.6.0. Audit existing logs for exposed credentials.","message":"Security: broker URLs containing passwords were logged in plaintext by the delayed delivery mechanism before 5.6. Credentials visible in log files.","severity":"breaking","affected_versions":"< 5.6"},{"fix":"Start Redis locally: docker run -d -p 6379:6379 redis. Then set broker='redis://localhost:6379/0' in your Celery app.","message":"Celery 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Set backend= in Celery() constructor or result_backend in app.conf. For Redis: backend='redis://localhost:6379/0'.","message":"The 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Convert task arguments to JSON-serializable types before calling .delay(). For datetime: pass .isoformat() string, parse inside the task.","message":"Task 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.","severity":"gotcha","affected_versions":">= 5.0"},{"fix":"Define the Celery app in a separate module file (e.g. tasks.py). Start worker with: celery -A tasks worker","message":"In 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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2026':12 '3.9':15 '5.0':42 '5.5':48,59 '5.6':52,60,72 '5.6.2':10 'alway':22 'async':77 'broker':17,30,64 'built':28 'built-in':27 'celeri':1,35,41 'config':33 'current':7 'distribut':2,76 'etc':38 'fix':63 'jan':11 'log':68 'lowercas':32 'need':55 'old':31 'password':66 'plaintext':70 'pycurl':45,56 'python':6,14 'queue':4,75 'rabbitmq':20,79 'redi':18,78 'reinstal':57 'remov':39 'requir':13,23 'revert':50 'schedul':81 'secur':62 'serial':37 'set':34 'sqs':43,53 'task':3,36,74 'task-queu':73 'transport':44 'upgrad':61 'url':65 'urllib3':46 'user':54 'version':8 'worker':80","created_at":"2026-03-27T05:01:27.842523+00:00","updated_at":"2026-04-16T01:40:32.927958+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"5.6.3","cli_name":"celery","cli_version":"5.6.3 (recovery)","type":"library","homepage":"https://docs.celeryq.dev/","github":"https://github.com/celery/celery","docs":"https://docs.celeryq.dev/en/stable/","changelog":"https://docs.celeryq.dev/en/stable/changelog.html","pypi":"https://pypi.org/project/celery/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["workflow","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":"verified"}}