uv
An extremely fast Python package and project manager, written in Rust — a drop-in replacement for pip, pip-tools, pipx, poetry, pyenv, and more.
uv is an all-in-one Python package and project manager written in Rust by
Astral — the team behind ruff. It replaces a sprawling
ecosystem of Python tools (pip, pip-tools, pipx, poetry, pyenv,
virtualenv) with a single, unified binary that is 10–100× faster than its
Python-based equivalents.
Features
- Blazing fast — installs packages 10–100× faster than
pipthanks to a parallel, Rust-native resolver and installer - Drop-in pip replacement —
uv pip install,uv pip freeze,uv pip syncare fully compatible with existing workflows - Project management — manages
pyproject.toml-based projects with lockfiles, similar topoetryorpdm - Python version management — downloads and manages Python interpreters,
replacing
pyenv - Tool runner — run CLI tools in isolated environments with
uvx, replacingpipx - Script runner — run single-file Python scripts with inline dependency
declarations (
uv run) - Virtual environments — creates and manages
.venvenvironments automatically - Universal lockfile —
uv.lockis cross-platform and human-readable - Workspace support — manage monorepos with multiple Python packages from one root
Installation
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Debian / Fedora
# Official install script (works on all Linux distributions):
# curl -LsSf https://astral.sh/uv/install.sh | sh
# via cargo
cargo install uv
# Homebrew (macOS)
brew install uv
# Windows (PowerShell)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"Usage
As a pip replacement
# Install a package
uv pip install requests
# Install from a requirements file
uv pip install -r requirements.txt
# Sync an environment to exactly match requirements
uv pip sync requirements.txt
# Compile requirements.in to a pinned requirements.txt
uv pip compile requirements.in -o requirements.txtProject management
# Create a new project
uv init my-project
cd my-project
# Add a dependency (updates pyproject.toml and uv.lock)
uv add requests
# Remove a dependency
uv remove requests
# Install all project dependencies
uv sync
# Run a command inside the project environment
uv run python main.py
uv run pytestPython version management
# Install a specific Python version
uv python install 3.12
# List available Python versions
uv python list
# Pin the Python version for a project
uv python pin 3.11Running tools with uvx
# Run a CLI tool without installing it globally
uvx ruff check .
uvx black --check .
uvx httpie GET httpbin.org/getSingle-file scripts
# Run a script, installing its declared dependencies automatically
uv run script.py
Declare dependencies inline in the script:
# /// script
# dependencies = ["requests", "rich"]
# ///
import requests
from rich import print
print(requests.get("https://httpbin.org/get").json())Why uv over pip/poetry?
The speed difference is dramatic on cold installs — installing the scientific Python stack (numpy, pandas, matplotlib) takes seconds instead of minutes. Beyond speed, having a single binary that covers the entire Python toolchain (versions, environments, packages, scripts, tools) eliminates the confusion around which tool to use for which task.