pip was released in 2008. Its resolver got serious in 2020. For most of its life it did not actually resolve dependencies, it just installed whatever it found first and hoped the graph was consistent. That history is baked into how it feels to use: slow, sequential, and willing to let you build a broken environment without complaint. uv is what you get when someone looks at that and decides the whole stack, not just the installer, needs rewriting.

I have been running uv as the default on every new project for about a year now, and I have migrated two older services onto it. The headline is the speed, but the speed is not why it stuck. It stuck because one binary replaced pip, pip-tools, virtualenv, and pyenv, and the lockfile resolves correctly on the first try instead of after three rounds of pinning and repinning. This post is the walkthrough I wish I had when I started.

Start With Why pip Is Slow

The naive mental model is that installing packages is network-bound, so nothing can be much faster than pip because you are limited by download speed. That is wrong, and understanding why tells you where uv wins.

Here is what pip does when you run pip install:

  • Download a candidate package.
  • Unpack it, read its metadata, discover its dependencies.
  • Download those, read their metadata, discover theirs.
  • Repeat, mostly sequentially, backtracking when it hits a conflict.
  • Copy files into site-packages one at a time.

The resolution step is the expensive one, and pip does it by downloading packages just to read their dependency metadata, because for a long time that was the only reliable way to get it. Each conflict means backtracking and re-downloading. On a large graph this turns into minutes of mostly-waiting.

uv does the same logical work but with a different engine. It is written in Rust, it downloads and unpacks in parallel, it uses a global content-addressed cache so the same wheel is never fetched or copied twice, and it hardlinks files into the environment instead of copying them. The resolver is a proper PubGrub implementation that reads metadata without downloading full packages where the index supports it.

Operationpipuv
Cold install, ~200 deps, no cache90s6s
Warm install, cache populated25s0.4s
Full resolve to lockfile40s2s
Create venv + install dev deps30s1.5s

These are from a mid-sized FastAPI service with pandas, pydantic, and the usual test tooling. The warm-install number is the one you feel every day. When installing is effectively free, you stop avoiding it.

Project Setup

Forget the ceremony. A new project is one command.

uv init payments-api
cd payments-api

That gives you a pyproject.toml, a .python-version file, a README.md, and a stub main.py. No virtualenv to activate yet, no requirements.txt to maintain. Add dependencies and uv creates the environment on demand:

uv add fastapi uvicorn httpx
uv add --dev pytest ruff mypy

After the first uv add, there is a .venv in the project root and a uv.lock next to pyproject.toml. You do not activate anything. You run code through uv:

uv run uvicorn main:app --reload
uv run pytest
uv run ruff check .

uv run ensures the environment matches the lockfile before it runs the command, so a teammate who pulls a branch with new dependencies gets them installed automatically on their next uv run. No more “did you pip install the new thing” in standup.

The pyproject.toml it writes is standard PEP 621, nothing uv-specific in the core metadata:

[project]
name = "payments-api"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = [
    "fastapi>=0.115",
    "httpx>=0.28",
    "uvicorn>=0.32",
]

[dependency-groups]
dev = [
    "mypy>=1.13",
    "pytest>=8.3",
    "ruff>=0.8",
]

Note [dependency-groups], which is PEP 735. Dev dependencies live here and are installed by default for local work but excluded from the published package. This replaces the old pattern of stuffing everything into optional-dependencies and remembering which extras were really just dev tooling.

The Lockfile Actually Locks

pip-tools gave us requirements.in compiled to a pinned requirements.txt. It worked, but it was platform-specific and you re-ran pip-compile by hand. Poetry had a lockfile but a resolver that could sit for minutes on a hard graph and occasionally produced a lock that failed to install.

uv’s uv.lock is cross-platform and universal. It records the fully resolved graph with hashes for every supported platform and Python version in one file, so a Mac developer and a Linux CI runner resolve to the same versions from the same lock. You never edit it by hand. It updates when you uv add, uv remove, or uv lock.

uv lock                 # re-resolve, update the lock
uv sync                 # make the venv exactly match the lock
uv sync --frozen        # fail if the lock is out of date, do not re-resolve

uv sync --frozen is the one you want in CI and in your Docker build. It is the “trust the lock, do not think” mode. If the lock and pyproject.toml have drifted, the build fails loudly instead of silently resolving something new.

The resolver is strict by default. If package A needs requests>=2.28 and package B pins requests==2.27, uv tells you exactly which two requirements conflict, in plain language, instead of backtracking silently into some surprising older version the way pip can. That single behavior has saved me more time than the speed has.

Python Versions Without pyenv

This is the part people underestimate. pyenv is a shell-shim system that compiles Python from source, which is slow and breaks in interesting ways when your OpenSSL headers move. uv downloads prebuilt standalone Python builds and manages them itself.

uv python install 3.12 3.13      # download both, no compilation
uv python list                   # show installed and available
uv python pin 3.13               # write .python-version for this project

When a project pins 3.13 and that version is not installed, uv run and uv sync download it automatically. There is no shim layer intercepting every python call, no eval "$(pyenv init -)" in your shell rc. The version is a property of the project, recorded in .python-version, and uv provisions it when needed.

For a throwaway script that needs a specific interpreter:

uv run --python 3.11 script.py

uv fetches 3.11 if it is missing, runs the script, and you move on. I deleted pyenv from my machine and have not missed it.

PEP 723 inline metadata pairs well with this. You can declare a script’s dependencies in a comment block and run it with zero setup:

# /// script
# requires-python = ">=3.12"
# dependencies = ["httpx", "rich"]
# ///
import httpx
from rich import print

print(httpx.get("https://httpbin.org/get").json())
uv run fetch.py

uv reads the header, builds a throwaway environment, caches it, and runs the file. No venv, no install step you manage. This has quietly replaced most of my “quick utility script” friction.

The Workspace Model for Monorepos

The naive approach to a Python monorepo is several packages, each with its own virtualenv, each pip install -e ../other-package pointed at its sibling. It works until you upgrade a shared dependency and have to do it in five places, and until two packages resolve the same transitive dependency to different versions and you get a bug that only reproduces in one service.

uv workspaces fix this with a single lockfile across all members. One resolution, one set of versions, many packages.

monorepo/
├── pyproject.toml          # workspace root
├── uv.lock                 # one lock for everything
├── packages/
│   ├── core/
│   │   └── pyproject.toml
│   └── billing/
│       └── pyproject.toml
└── services/
    ├── api/
    │   └── pyproject.toml
    └── worker/
        └── pyproject.toml

The root declares the members:

[tool.uv.workspace]
members = ["packages/*", "services/*"]

A service depends on a local package by naming it as a workspace source:

# services/api/pyproject.toml
[project]
name = "api"
dependencies = ["core", "billing", "fastapi>=0.115"]

[tool.uv.sources]
core = { workspace = true }
billing = { workspace = true }

Now uv sync at the root resolves every member together against one dependency set. If core and billing both use pydantic, they get the same pydantic. Upgrade it once at the root and every member moves together. You can still work inside a single member:

uv run --package api pytest
uv sync --package worker

The win is not convenience, it is correctness. There is exactly one resolved version of every dependency in the repo, verified by one lockfile, and you cannot accidentally ship two services that disagree on a transitive version.

CI Cache Patterns That Cut Build Time in Half

This is where the speed translates into money. The two things worth caching are the uv cache directory and the resolved environment. On GitHub Actions the official setup action handles most of it.

name: ci
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install uv
        uses: astral-sh/setup-uv@v4
        with:
          enable-cache: true
          cache-dependency-glob: "uv.lock"

      - name: Install Python
        run: uv python install

      - name: Sync (frozen, no dev of other groups)
        run: uv sync --frozen

      - name: Lint and test
        run: |
          uv run ruff check .
          uv run pytest -q

enable-cache: true caches the global uv cache keyed on uv.lock, so the cache is reused across runs until a dependency actually changes. uv sync --frozen refuses to re-resolve, which means CI fails fast if someone pushed a pyproject.toml change without updating the lock. That is a feature: a stale lock is a bug you want caught in CI, not papered over.

For Docker, the pattern that matters is caching the uv download directory across builds and copying only the lock and manifest before syncing, so a code change does not bust the dependency layer.

FROM python:3.13-slim
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

WORKDIR /app

# Dependency layer: changes only when the lock or manifest changes
COPY pyproject.toml uv.lock ./
RUN --mount=type=cache,target=/root/.cache/uv \
    uv sync --frozen --no-install-project --no-dev

# App layer: changes on every code edit, but deps are already cached above
COPY . .
RUN --mount=type=cache,target=/root/.cache/uv \
    uv sync --frozen --no-dev

ENV PATH="/app/.venv/bin:$PATH"
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

Two things make this fast. The --mount=type=cache keeps uv’s wheel cache warm between builds, so even a cold dependency layer only downloads what genuinely changed. And splitting --no-install-project from the final sync means editing application code reuses the dependency layer entirely. On a service with a heavy dependency graph, this took a representative image build from roughly four minutes to under ninety seconds, and most incremental builds now skip the dependency step completely.

Build timeline, heavy dependency graph

pip + requirements.txt:
[checkout][----- pip install 210s -----][build 30s]  total ~4m

uv, cold cache:
[checkout][- uv sync 48s -][build 30s]               total ~1m20s

uv, warm cache (code-only change):
[checkout][sync 6s][build 30s]                        total ~40s

Migrating an Existing Project

You do not need to rewrite anything. uv reads requirements.txt and speaks pip’s command surface through uv pip.

# Drop-in: same commands, 10-100x faster, into the active venv
uv venv
uv pip install -r requirements.txt

# Or move to the managed workflow
uv init --no-workspace
uv add -r requirements.txt       # import existing pins as dependencies
uv lock

uv pip install and uv pip compile are deliberate parity layers for the pip-tools and raw-pip workflows. They let a team adopt uv for the speed before committing to pyproject.toml and uv.lock. I usually run the uv pip compatibility mode for a week, confirm nothing breaks, then convert to the native project workflow.

What Works and What Does Not

What works, without caveats: the speed is real and it changes how you work, because a free install is a different thing from a slow one. The single universal lockfile is the correct design and it ends the class of bugs where two machines resolve differently. Python version management genuinely retires pyenv. The workspace model is the first Python monorepo story that is actually about correctness rather than wiring.

What does not, yet: if you publish libraries with elaborate build backends or complex distribution matrices, uv’s project workflow is solid but Poetry and Hatch still have deeper, more battle-tested publishing features, so evaluate before you switch those. uv is a single company’s tool, and while it is open source and moving fast, it is not yet a standard blessed by the Python Steering Council the way cargo is blessed for Rust. If your organization is conservative about depending on one vendor’s binary, that is a real consideration, though the fallback to uv pip and plain pip is always there.

What to actually do: for any new application, start with uv init and do not look back. For an existing project, adopt uv pip install first for the immediate speed win, then migrate to uv.lock and uv sync --frozen in CI when you are ready. Pin your Python with uv python pin and delete pyenv. If you run a monorepo, move it to a workspace and get one lockfile. The tool that finally makes Python packaging feel like a solved problem is here, and it is the uncomfortable truth that it came from outside the traditional packaging stack rather than from fixing pip in place.