Installation
Uvicorn is available on PyPI so installation is as simple as:
pip install uvicorn
uv add uvicorn
The above will install Uvicorn with the minimal set of dependencies:
If you are running on Python 3.10 or early versions,
typing_extensions will also be installed.
Optional Dependencies¶
There are many optional dependencies that can be installed to add support for various features.
If you just want to install all of them at once, you can use the standard extra:
pip install 'uvicorn[standard]'
uv add 'uvicorn[standard]'
The standard extra installs the following dependencies:
-
uvloop— Fast, drop-in replacement of the built-in asyncio event loop.When
uvloopis installed, Uvicorn will use it by default. -
httptools— Python binding for the Node.js HTTP parser.When
httptoolsis installed, Uvicorn will use it by default for HTTP/1.1 parsing.You can read this issue to understand how it compares with
h11: h11/issues/9. -
websockets— WebSocket library for Python.When
websocketsis installed, Uvicorn will use it by default for WebSocket handling.You can alternatively install
wsprotoand set the--wsoption towsprototo use it instead. -
watchfiles— Simple, modern and high performance file watching and code reload in python.When
watchfilesis installed, Uvicorn will use it by default for the--reloadoption. -
colorama— Cross-platform support for ANSI terminal colors.This is installed only on Windows, to provide colored logs.
-
python-dotenv— Reads key-value pairs from a.envfile and adds them to the environment.This is installed to allow you to use the
--env-fileoption. -
PyYAML— YAML parser and emitter for Python.This is installed to allow you to provide a
.yamlfile to the--log-configoption.