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 Velloreth
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 way | uv way |
|---|---|
python -m venv .venv && source .venv/bin/activate | uv venv then uv sync handles it |
pip install requests | uv add requests |
pip freeze > requirements.txt | uv lock produces uv.lock |
pip install -r requirements.txt | uv sync reproduces exactly |
pip install -e . | uv sync plus uv build |
python script.py | uv 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 mypyorpyright, run inuv run. Typed code is AI-reviewable code. - Ruff by default. Same vendor, same speed philosophy:
uvx ruff check --fixwithout installing. - Pin Python too.
requires-python = ">=3.12"in pyproject plus.python-versionfile. uv respects both. - Lock in CI. Commit
uv.lock, runuv sync --frozenin 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.