Skip to content
Velloreth
Developer Tools 3 min read

uv: The Python Package Manager That Replaced pip

uv rewrote Python packaging in Rust with 10-100x faster installs, unified venvs, lockfiles, and script running. Setup, commands, and migration from pip and Poetry.

By

Python packaging used to be archaeology: pip, venv, requirements.txt, pip-tools, pyenv, Poetry, PDM — five tools arguing about one environment. uv collapses them into one Rust binary that feels instant.

You are already running Rust even if you write Python. Ruff replaced Flake8, uv replaced pip — same language you love, toolchain rewritten for speed.

Install in 30 seconds

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

# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

# Or via pipx / brew
pipx install uv
brew install uv

uv --version
uv python list

uv python list shows available interpreters. uv python install 3.12 fetches one without touching system Python.

The unified workflow

Old wayuv way
python -m venv .venv && source .venv/bin/activateuv venv then uv sync handles it
pip install requestsuv add requests
pip freeze > requirements.txtuv lock produces uv.lock
pip install -r requirements.txtuv sync reproduces exactly
pip install -e .uv sync plus uv build
python script.pyuv run script.py

Start a project:

uv init myapp && cd myapp
uv add fastapi uvicorn pydantic
uv run fastapi dev main.py

That creates pyproject.toml, .venv, and uv.lock. uv sync on another machine reproduces the exact environment — no more works-on-my-laptop requirements drift.

Scripts with inline deps — the killer feature for tutorials:

# /// script
# requires-python = ">=3.12"
# dependencies = ["httpx"]
# ///
import httpx
print(httpx.get("https://example.com").status_code)
uv run script.py

No venv, no install step. Perfect for the CLI tools and repro scripts this blog ships.

Speed that changes habits

Astral benchmarks show 10-100x faster cold installs vs pip by parallel downloads, global cache, and skipping redundant builds. Practical effect: you stop dreading fresh environments. CI that spent 3 minutes installing now spends 20 seconds. You actually test on clean envs instead of reusing a stale one.

Cache lives in one place (~/.cache/uv), shared across projects. Disk usage drops because wheels are hardlinked, not copied per-venv.

Migration without fear

Per-project, reversible:

cd legacy-project
uv venv
uv pip install -r requirements.txt
uv run pytest

uv pip is a drop-in pip with the fast resolver. Once green, graduate:

uv init --bare  # or add pyproject manually
uv add -r requirements.txt
uv lock

Keep requirements.txt exported for old deploy targets via uv pip compile pyproject.toml -o requirements.txt. Delete it when nothing reads it.

Poetry migrants: uv reads pyproject.toml dependencies directly. Move dev groups to dependency-groups, replace poetry run with uv run, replace poetry publish with uv build && uv publish. The one gap is exotic plugins — check those before committing.

Modern Python habits uv enables

  • Type hints everywhere. uv add mypy or pyright, run in uv run. Typed code is AI-reviewable code.
  • Ruff by default. Same vendor, same speed philosophy: uvx ruff check --fix without installing.
  • Pin Python too. requires-python = ">=3.12" in pyproject plus .python-version file. uv respects both.
  • Lock in CI. Commit uv.lock, run uv sync --frozen in CI. Reproducible builds stop being a wish.
# .github/workflows/ci.yml
- uses: astral-sh/setup-uv@v3
- run: uv sync --frozen
- run: uv run pytest

When not to switch yet

Stay on pip plus venv on minimal servers you SSH into where uv is not installed, in containers that already bake a blessed image, or where corporate proxy rules whitelist only PyPI via pip. Everywhere you control the machine, uv is the default in 2026.

Install it once, use uv run everywhere, and Python packaging stops being the slowest part of your day.

Frequently asked questions

What is uv?
A unified Python package and project manager from Astral written in Rust. It installs packages 10-100x faster than pip, manages virtualenvs, lockfiles, Python versions, and even standalone script dependencies in one tool.
Should I replace pip with uv?
Yes for new projects, and incrementally for old ones. uv understands requirements.txt and pyproject.toml, so you can adopt per-project without breaking existing setups. Keep pip available for servers you SSH into.
Does uv replace Poetry or PDM?
For most projects, yes. uv covers dependency resolution, locking, syncing, building, and publishing. Poetry plugins and monorepo extras are the main reasons teams stay — evaluate those before switching.
Is uv production ready in 2026?
Yes. It powers CI at major Python shops, has stable lockfile semantics, and ships via official installers plus PyPI. Pin a version in CI and treat upgrades like any toolchain bump.