uv Python: Replace Your Entire Toolchain With One Binary
uv replaces pip, pyenv, virtualenv, pip-tools, and pipx with one Rust binary. Complete guide to installation, commands, Docker integration, and migration paths.

uv replaces pip, pyenv, virtualenv, pip-tools, and pipx with one Rust binary. Complete guide to installation, commands, Docker integration, and migration paths.

uv is a Python package and project manager built in Rust that replaces pip, pyenv, virtualenv, pip-tools, and pipx with a single binary. As of June 2026, it drives 162 million monthly PyPI downloads and handles more than 10% of all PyPI request traffic.
The speed headline (10-100x faster than pip) is real, but secondary. The primary value is collapsing a five-tool chain into one command surface that requires no Python to install.
Before uv, a typical Python developer managed pyenv for interpreter versions, virtualenv for environment isolation, pip-tools for dependency locking, pip for installation, and pipx for running CLI tools globally. uv handles all five.
This guide covers installation, the core command surface, the two-interface distinction most tutorials skip, Docker integration, PEP 723 inline scripts, and the OpenAI acquisition context relevant to long-term adoption decisions.
uv add is the modern workflow; uv pip install is the migration ramp, and they serve different purposesuv run makes manual activation unnecessaryuv.lock cross-platform lockfile replaces both requirements.txt and pip-tools workflowsAstral, the developer tooling company behind the Ruff linter, built uv. Charlie Marsh, Astral's founder, announced it in February 2024. By June 2026, uv reached 86,725 GitHub stars and version 0.11.24, shipping on a roughly weekly release cadence.
The scope is wider than most introductions cover. u/TheCaptain53 in r/Python (August 2025) describes it:
"It's not just pip but faster, or just venv but faster, but it's the ability to take the functionality of many different applications and bung it into one. Need to run a different version of Python? uv can do that, don't need Pyenv. Need to run a virtual environment? uv can do that, no need to manually create a venv. Need to install packages? uv can do that and faster than pip."
Charlie Marsh's stated ambition is a Python equivalent of Cargo, Rust's package manager. In August 2024, he announced: "A single, unified tool. Like Cargo, for Python." (Charlie Marsh (@charliermarsh), 3,338 likes.)
Python toolchain fragmentation has been the ecosystem's most persistent friction point for a decade. Managing pyenv, virtualenv, pip, pip-tools, and pipx separately means five configuration systems, five CLIs to keep updated, and zero shared state between them.
uv collapses that stack. The official benchmarks on Apple Silicon show the order-of-magnitude difference: 0.008 seconds for uv versus 1.15 seconds for python -m venv. Cold-installing 23 packages takes 1.187 seconds with uv versus 8.889 seconds with pip.
When creation is that fast, the developer relationship to virtual environments changes. In his Jane Street talk, Marsh explains:
"destroying and creating a virtual environment is extremely fast... we try to view them as totally ephemeral."
Jobs previously run only in CI become viable as pre-commit hooks.

The recommended installation uses the standalone installer, which requires no Python or Rust prerequisite:
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Three alternatives also work: brew install uv on Homebrew, pip install uv, or pipx install uv. The binary installs to ~/.local/bin by default.
Verify with uv --version. Stay current with uv self update; uv ships approximately weekly and the dependency resolver improves with each release.
uv's commands organize into five functional layers, each replacing a specific part of the traditional Python stack.
This is the destination, not the migration ramp. These commands manage a full project with automatic environment and lockfile maintenance:
uv init myproject # scaffold pyproject.toml, .python-version, README, starter script
uv add requests # install + update pyproject.toml + uv.lock + .venv
uv add --dev pytest ruff # add development dependencies
uv remove requests # remove + clean up all three files atomically
uv sync # install from lockfile (first-clone onboarding)
uv run script.py # run in project environment, no activation neededThe key property is atomicity. A single uv add updates pyproject.toml, uv.lock, and .venv in one operation. There is no separate pip freeze > requirements.txt step and no manual venv activation.
These commands behave like pip but run through uv's faster resolver and global cache:
uv pip install requests # install without touching pyproject.toml
uv pip install -r requirements.txt # bulk install from requirements file
uv pip compile requirements.in -o requirements.txt # pip-compile replacement, ~20x fasterThe key distinction: uv pip install does NOT update pyproject.toml or uv.lock. u/xenomachina in r/learnpython (April 2026) captures what changes when you move beyond this layer:
"Even if uv wasn't faster than pip, the thing I love about it is that it makes dealing with venvs so much nicer. You can almost forget they even exist. Just use uv to run your code, and it'll create a venv if one doesn't already exist, make sure it's up to date, and then run your code in that venv."
This layer is the ramp for adoption. Layer 1 is the destination.
uv python install 3.12 # download prebuilt binary, no source compilation
uv python list # list installed and available versions
uv python pin 3.12 # write .python-version for the current directoryuv downloads prebuilt Python binaries from the python-build-standalone project rather than compiling from source. This makes version installs nearly instant versus pyenv's multi-minute compile process.
The trade-off: uv-managed Python binaries are approximately 3% slower than natively compiled versions on CPU-bound benchmarks (measured via pyperformance). For web services, scripting, and automation, the difference is undetectable.
uv tool install ruff # install CLI tool globally in isolated environment
uvx ruff check . # run tool in temporary environment, no permanent installuvx runs any CLI tool without permanent installation. The environment is cached for fast subsequent runs. This replaces pipx's core use case.
uv build # build source and wheel distributions
uv publish --token # publish to PyPIA uv project organizes around four files. Understanding what each does explains why uv add is structurally cleaner than the pip + requirements.txt workflow.
File | Purpose |
|---|---|
| Declares project metadata and direct dependencies (equivalent to requirements.in) |
| Exact resolved set of all direct and transitive dependencies, cross-platform; commit this |
| Pins Python version for the project; read automatically by uv |
| Project environment managed by uv; do not commit |
The uv.lock file is designed for cross-platform use. It encodes platform-specific markers so macOS, Linux, and Windows developers get consistent environments from the same file. This solves the "works on my machine" problem that pip freeze snapshots create when generated on one OS and used on another.

The workflow gap shows up in step count. Corey Schafer's uv tutorial on YouTube counts: the standard pip/venv new-project setup takes 6 manual operations before writing any application code. uv reduces it to two commands.
Task | pip + venv | uv |
|---|---|---|
Create environment |
| Automatic on first |
Activate environment |
| Unnecessary; use |
Install a package |
|
|
Install from lockfile | Manual pip-tools workflow |
|
Run a script | Requires active venv |
|
Cross-platform lock | Extra tooling required | Built into |
The first-clone workflow makes the difference concrete: git clone <repo>, cd <repo>, uv sync. One command installs the exact locked dependency set, creates the venv, and leaves you ready to run. No activation, no pip invocation, no requirements file management.
For developers new to Python, including those starting with Python for beginners resources, managing multiple Python versions was historically one of the first roadblocks.
uv python install 3.12 downloads a prebuilt binary in seconds. uv python pin 3.12 writes a .python-version file that all subsequent uv commands read automatically. Multiple versions coexist without conflict, and you switch per project by changing the pin.
Two constraints to check. First, uv-managed Python binaries don't include Tkinter or OpenSSL by default; install those separately if needed. Second, available versions depend on the python-build-standalone release schedule, which tracks CPython closely but may lag slightly on the newest releases.
Docker builds are where uv's speed differential becomes measurable cost. A Flask + pandas cold install takes 3.2 seconds with uv versus 47 seconds with pip in practitioner benchmarks.
The standard Dockerfile pattern copies dependency files before source code to maximize Docker layer caching:
# Install uv binary
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Copy dependency files first (this layer gets cached when only source code changes)
COPY pyproject.toml uv.lock ./
# Install dependencies only (no dev dependencies, frozen lockfile)
RUN uv sync --frozen --no-dev
# Copy application source
COPY . .The --frozen flag verifies the lockfile is current before installing, which prevents silent dependency drift in production builds.
For GitHub Actions, the official astral-sh/setup-uv@v3 action handles installation and caching. Azure App Service for Linux added native uv detection in November 2025: it automatically detects pyproject.toml + uv.lock and builds without additional configuration.
For Python automation pipelines, CI jobs that previously required 3-5 minutes for dependency installation complete in under 30 seconds with uv, fast enough to run as a pre-commit hook.
uv supports PEP 723 inline script metadata, which lets you declare dependencies directly inside a script file header:
# /// script
# dependencies = ["requests", "rich"]
# requires-python = ">=3.11"
# ///
import requests
from rich import print
response = requests.get("https://api.github.com/zen")
print(response.text)Run with uv run script.py. uv installs the declared dependencies on first run and caches the environment for subsequent runs. No project scaffold, no venv, no pip invocation.
Simon Willison (@simonw) described the use case for LLM-generated scripts in December 2024:
I figured out this prompting pattern for getting Claude to produce fully self-contained Python scripts that execute with "uv run" using PEP 723 inline script dependencies - and now I can one-shot useful Python tools with it https://t.co/POTVFB1UR1
This pattern applies to any Python web scraping task or one-off automation where you want a self-contained script that runs anywhere uv is installed. The file carries its own dependency declaration, making it shareable and reproducible without a separate requirements file.
Both uv and Poetry use pyproject.toml as the project file. uv is a functional superset: built-in Python version management, a cross-platform lockfile, and 10-100x faster resolution.
Feature | uv | Poetry |
|---|---|---|
Speed | 10-100x faster than pip | Faster than pip, slower than uv |
Python version management | Built-in | Not built-in |
Lock file format |
|
|
Project format | Standard PEP 621 | PEP 621 since Poetry 2.0 (January 2025) |
Monthly PyPI downloads |
The lock-in concern surfaced frequently after the OpenAI/Astral acquisition. u/tdh3m in r/Python (May 2026) addressed it directly:
"Your dependencies live in standard pyproject.toml (PEP 621), not a proprietary format. If development stalls, you keep your pyproject.toml, swap the [build-system] to hatchling or setuptools, and move on. Poetry actually has more lock-in: its dependency group syntax and some metadata conventions are Poetry-specific, so migrating away is a heavier lift than migrating away from uv."
The migration commands map nearly 1:1:
poetry add httpx → uv add httpxpoetry install → uv syncpoetry run pytest → uv run pytestpoetry build → uv buildMigrate in stages. Start by replacing pip install with uv pip install to get the speed benefit. For the full project workflow:
uv init .
uv add -r requirements.in
uv syncDelete your existing .venv and let uv create a fresh one via uv sync.
Replace pip-compile with uv pip compile requirements.in -o requirements.txt. It is a drop-in replacement running approximately 20x faster. Adopt the full project workflow with uv init when ready.
poetry add becomes uv add. poetry install becomes uv sync. poetry run becomes uv run.
The main practical difference: uv.lock is cross-platform by default, while poetry.lock may encode platform-specific markers that cause divergence across operating systems.
A practitioner assessment from bitecode.dev after a full year of uv in production identifies the real edge cases:
When the stricter resolver breaks legacy projects. uv's CDCL SAT resolver is stricter than pip's backtracking resolver. Legacy pip freeze exports from codebases with accumulated constraint conflicts may produce resolution failures that pip would have silently accepted. Cleaning up the dependencies is the right fix; if that's not feasible, stick with pip for that project.
When cache growth becomes an issue. The global content-addressed cache can exceed 20GB after a year of heavy use across many projects. uv cache prune removes unused artifacts without clearing the full cache.
When GitHub Dependabot security scanning is required. Dependabot supports updating uv.lock but has limited vulnerability alert support. If full automated dependency security scanning is a hard requirement, verify current support before migrating.
When your team has a functioning Poetry workflow. Tool migrations have real costs: retraining, CI changes, and workflow disruptions. If Poetry is working, migration payoff depends on team size and how often you're hitting performance limits.
New projects, standard web and data analysis workflows, and any team running CI won't encounter these limits.
Astral raised a $4 million seed round from Accel in April 2023, plus undisclosed Series A and B rounds. The company builds uv, Ruff (48,202 GitHub stars), and ty (a Python type checker, currently in beta).
On March 19, 2026, OpenAI announced the acquisition of Astral to integrate its tooling into the Codex platform. OpenAI committed to continuing uv, Ruff, and ty as open-source MIT-licensed projects post-acquisition.
The community reaction on r/Python has been pragmatic rather than alarmed. Since uv uses standard PEP 621 format, a developer who wants to stop using uv keeps their pyproject.toml unchanged and switches only the build backend.
Simon Willison raised the question of whether open-source Python infrastructure could become a competitive moat for OpenAI. The open question is whether that commitment holds long-term.
Read the Docs added native uv support in April 2026. Sebastián Ramírez migrated FastAPI, Typer, SQLModel, and Asyncer to uv for all development and CI in October 2024:
Now all my projects (@FastAPI, Typer, SQLModel, Asyncer, etc) use uv to install packages in development and CI. 🚀 Much simpler, faster, clearer. ✨

LangChain wins for stateful multi-agent orchestration and the broadest integration surface. LlamaIndex wins when retrieval accuracy over private documents is the primary requirement.

Playwright wins for new Python projects in 2026. It runs 44% faster than Selenium on React SPAs, eliminates flaky waits with built-in auto-waiting, and ships both sync and async Python APIs out of the box.

uv is 4–16× faster than Poetry and replaces 7 Python tools in one binary. Poetry still wins for PyPI library publishing. A 2026 decision guide.