ScriptsMar 29, 2026·2 min read

UV — Ultra-Fast Python Package Manager

Rust-powered Python package and project manager. 10-100x faster than pip. Drop-in replacement with lockfiles, virtual environments, and Python version management.

TL;DR
UV manages Python packages, virtual environments, and Python versions at 10-100x pip speed using Rust.
§01

What it is

UV is a Python package and project manager written in Rust by the team behind Ruff. It serves as a drop-in replacement for pip, pip-tools, pipenv, poetry, pyenv, and virtualenv -- all in a single binary. UV handles dependency resolution, lockfile generation, virtual environment creation, and even Python version installation.

Developers tired of juggling multiple Python tooling layers benefit most. If you have ever waited minutes for pip to resolve dependencies on a large project, UV cuts that to seconds.

§02

How it saves time or tokens

UV achieves 10-100x speed improvements over pip through Rust's performance and a global dependency cache. Instead of re-downloading packages for every virtual environment, UV hardlinks from a shared cache. Lockfiles (uv.lock) ensure reproducible installs across machines without the guesswork of pip freeze. The single-binary design also eliminates the bootstrap problem -- no need for pip to install pip.

§03

How to use

  1. Install UV with a single command:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create a new project with a virtual environment and lockfile:
uv init my-project
cd my-project
uv add requests flask
  1. Run your application inside the managed environment:
uv run python app.py

UV resolves, installs, and locks dependencies automatically. No pip install, no source venv/bin/activate, no manual requirements.txt management.

§04

Example

# Install a specific Python version and pin it
uv python install 3.12
uv python pin 3.12

# Add dev dependencies separately
uv add --dev pytest ruff mypy

# Sync all dependencies from lockfile (CI-friendly)
uv sync --frozen

# Run a one-off script without polluting your environment
uv run --with httpx python -c 'import httpx; print(httpx.get("https://httpbin.org/ip").json())'
§05

Related on TokRepo

Key considerations

When evaluating UV for your workflow, consider the following factors. First, assess whether your team has the technical prerequisites to adopt this tool effectively. Second, evaluate the maintenance burden against the productivity gains. Third, check community activity and documentation quality to ensure long-term viability. Integration with your existing toolchain matters more than feature count alone. Start with a small pilot project before rolling out across the organization. Monitor resource usage during the initial adoption phase to identify bottlenecks early. Document your configuration decisions so team members can onboard independently.

§06

Common pitfalls

  • UV uses pyproject.toml as the single source of truth. Mixing requirements.txt workflows with UV can cause confusion -- commit to one approach.
  • The global cache can grow large on machines with many projects. Run uv cache clean periodically to reclaim disk space.
  • Some legacy packages with complex C extensions may still require system-level build tools (gcc, libffi-dev) even though UV handles the Python side.

Frequently Asked Questions

How do I migrate from pip to UV?+

Run 'uv init' in your existing project directory. UV reads your existing requirements.txt or pyproject.toml and generates a uv.lock file. Replace 'pip install -r requirements.txt' with 'uv sync' in your CI pipeline. The migration is incremental -- UV understands pip's formats.

Does UV work on Windows?+

Yes. UV provides native binaries for Windows, macOS, and Linux. On Windows, install via 'powershell -c irm https://astral.sh/uv/install.ps1 | iex' or through winget, scoop, and chocolatey. Virtual environment activation uses the same 'uv run' command across platforms.

Can UV manage multiple Python versions?+

Yes. UV downloads and manages Python installations directly. Run 'uv python install 3.11 3.12 3.13' to install multiple versions, then 'uv python pin 3.12' to set the project default. No pyenv or system package manager required.

Is UV compatible with existing pyproject.toml files?+

UV reads and writes standard pyproject.toml following PEP 621. Projects already using pyproject.toml for metadata need minimal changes. UV adds its own sections for tool-specific config but respects the existing standard fields.

How does UV compare to Poetry?+

UV is significantly faster than Poetry for dependency resolution and installation. Both use lockfiles for reproducibility. UV additionally manages Python versions and virtual environments, while Poetry requires external tools for those. UV's Rust implementation gives it a raw speed advantage.

Citations (3)
🙏

Source & Thanks

Created by Astral. Licensed under Apache 2.0 / MIT. astral-sh/uv — 35K+ GitHub stars

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets