uv — Fast Python Package Manager
What is uv
uv is a Python package manager written in Rust. It solves one problem: the standard pip is slow at resolving dependencies, and poetry adds its own project model on top of PEP 621. uv works with pyproject.toml, is compatible with PEP 621 and PEP 508, and does it significantly faster.
Under the hood is a caching resolver written in Rust that reuses data from pip-compatible indexes (PyPI by default). uv can replace pip, pip-tools, virtualenv, and poetry in a single tool.
uv does not require an installed Python to install itself, but to work with Python projects you need an interpreter. uv can find and manage CPython via uv python.
Installation
The fastest path is the curl script:
This places the binary in ~/.local/bin. On systems without curl:
Or download the standalone binary from GitHub releases.
After installation, verify the version:
If uv is not found after installation, make sure ~/.local/bin is in your $PATH. On Debian/Ubuntu, the pip-installed package places it in /usr/local/bin.
Key commands
The project workflow:
Key flags for daily work:
| Flag | What it does |
|---|---|
--system | Installs a package into the system Python, bypassing venv |
--no-dev | Excludes dev dependencies during sync |
--group <name> | Specifies a named dependency group |
--python <version> | Selects a specific interpreter version |
--locked | Uses the lock file without re-resolving |
--quiet | Minimal output |
--verbose | Detailed output for debugging |
Managing interpreters:
For package-level work without creating a project:
uv sync recreates .venv and installs exactly what is in uv.lock. This makes it suitable for CI — the result is deterministic.
Comparison with pip and poetry
| Aspect | pip | poetry | uv |
|---|---|---|---|
| Implementation language | Python | Python + Rust | Rust |
| Project model | setup.py / pyproject.toml | pyproject.toml (custom format) | pyproject.toml (PEP 621) |
| Resolution speed | Slow | Medium | Fast |
| Lock file | No native | poetry.lock | uv.lock |
| Virtual environment | venv / virtualenv | Built-in | Built-in (.venv) |
| pip compatibility | Full | Partial | Full |
| Replaces pip | — | — | Yes |
| Replaces poetry | — | — | Yes (partially) |
uv wins on resolution speed — in astral-sh benchmarks it is 10–50x faster than pip on large dependency graphs. At the same time, uv pip is fully compatible with pip workflows: requirements.txt, --index-url, --find-links.
uv is under active development. The uv.lock format may change between major versions. In production CI pipelines, pin the uv version via uv --version or install a specific binary.
A common mistake is confusing uv add with uv pip install. The former writes the dependency into pyproject.toml and updates uv.lock; the latter works like pip directly. For projects with pyproject.toml, use uv add. For one-off scripts and Dockerfiles, use uv pip install.
Another frequent issue: uv cannot find the interpreter if Python is installed in a non-standard path. The fix is uv python install --force or explicit specification via --python /path/to/python.