Skip to content

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.

Note

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:

curl -LsSf https://astral.sh/uv/install.sh | sh

This places the binary in ~/.local/bin. On systems without curl:

pip install uv

Or download the standalone binary from GitHub releases.

After installation, verify the version:

uv --version
Warning

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:

uv init myproject          # creates pyproject.toml with PEP 621 metadata
cd myproject
uv add requests            # adds a dependency and updates uv.lock
uv add --group dev pytest  # adds a dependency to a named group
uv sync                    # synchronizes the environment with the lock file
uv run pytest              # runs a command inside the project's .venv

Key flags for daily work:

FlagWhat it does
--systemInstalls a package into the system Python, bypassing venv
--no-devExcludes dev dependencies during sync
--group <name>Specifies a named dependency group
--python <version>Selects a specific interpreter version
--lockedUses the lock file without re-resolving
--quietMinimal output
--verboseDetailed output for debugging

Managing interpreters:

uv python list             # shows discovered CPython installations
uv python install 3.12     # downloads and caches CPython 3.12
uv python find             # shows the path to the active Python

For package-level work without creating a project:

uv pip install requests    # pip equivalent, but faster
uv pip freeze              # lists installed packages
uv pip uninstall requests  # removes a package
Tip

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

Aspectpippoetryuv
Implementation languagePythonPython + RustRust
Project modelsetup.py / pyproject.tomlpyproject.toml (custom format)pyproject.toml (PEP 621)
Resolution speedSlowMediumFast
Lock fileNo nativepoetry.lockuv.lock
Virtual environmentvenv / virtualenvBuilt-inBuilt-in (.venv)
pip compatibilityFullPartialFull
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.

Warning

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.