Lightning-fast ASGI server for Python. Standard server for FastAPI and Starlette. Current version is 0.42.0 (Mar 2026). Requires Python >=3.10. The Gunicorn worker class was moved to a separate package.
pip install uvicornVerified import paths — ran on the pinned version, not inferred.
Common invocation patterns. Import string required for --workers and Gunicorn.
pip install uvicorn-worker, then use: gunicorn app:app -k uvicorn_worker.UvicornWorker
Pin uvicorn<0.32.0 for Python 3.8/3.9, or upgrade Python.
Upgrade uvicorn-worker to >=0.4.0 if using Gunicorn. Do not call config.setup_event_loop() directly.
Use pip install 'uvicorn[standard]' for development. For production containers, install uvicorn[standard] or add uvloop and httptools explicitly for performance.
Use --reload only in development (single process). Use --workers only in production.
uvicorn.run('main:app', workers=4) — always use import string with multiple workers.Expected behavior on Windows. No fix needed, but be aware of performance differences between dev (Windows) and prod (Linux).
Execute `uvicorn main:app --reload` directly in your shell/terminal, or if calling from a Python script, use `uvicorn.run('main:app', reload=True)`.Ensure `uvicorn` commands are executed in a shell (e.g., via `subprocess.run()` or a shell script), not parsed directly by the Python interpreter.