UV: The Blazing-Fast Python Package Manager That Replaces pip
Jun 19, 2026 5 Min Read 16 Views
(Last Updated)
Table of contents
- Quick TL;DR
- Introduction
- What is UV?
- What uv Replaces
- Installing uv
- Core Workflow: From Project Init to Running Code
- Starting a New Project
- Working with an Existing pip Project
- Managing Python Versions with uv
- Running Scripts and Tools with uv run
- Real-World Use Cases
- Common Mistakes When Switching to uv
- Conclusion
- FAQs
- What is uv in Python?
- Is uv a drop-in replacement for pip?
- How does uv compare to pip in speed?
- Does uv replace conda?
- What is a uv.lock file?
- What is uv run used for?
- Can uv manage Python versions like pyenv?
Quick TL;DR
- uv is a next-generation Python package manager written in Rust, built by Astral the team behind the Ruff linter.
- It is a drop-in replacement for pip, pip-tools, virtualenv, and pyenv in a single binary. uv installs packages 10 to 100 times faster than pip, manages Python versions natively, generates lock files, and runs scripts in isolated environments without any configuration.
- If you are learning Python, building data science pipelines, or maintaining production services, switching to uv cuts environment setup time from minutes to seconds and eliminates most dependency conflict headaches.
- It is the fastest-growing tool in the Python ecosystem in 2024–2025.
Introduction
Python’s packaging ecosystem has historically been its most criticised aspect. pip is slow. virtualenv is separate from pip. pip-tools adds another layer for lock files. pyenv is a different tool entirely for managing Python versions. A new project can require four separate tools and ten minutes of setup before writing a single line of code.
uv changes all of that. Written in Rust and released by Astral in February 2024, uv replaces the entire pip-centric toolchain with a single, blazingly fast binary. It resolves dependencies, creates virtual environments, locks packages, manages Python versions, and runs scripts — all faster than pip alone can install a single package. If you are a Python developer who has not yet tried uv, this guide will show you exactly what it is, how it works, and why it is rapidly becoming the standard.
Want to build a strong foundation in Python from package management and virtual environments to data science and machine learning workflows with structured guidance and real projects? Check out HCL GUVI’s Python Programming Course designed for students and professionals who want to go from beginner to job-ready Python developer.
What is UV?
uv is an extremely fast Python package and project manager written in Rust. It was created by Astral — the same team that built Ruff, the fastest Python linter. uv is designed as a unified replacement for the fragmented Python packaging toolchain.
What uv Replaces
- pip — package installation
- pip-tools — dependency compilation and lock files
- virtualenv / venv — virtual environment creation
- pyenv — Python version management
- pipx — running tools in isolated environments
uv achieves its speed through a global package cache, parallel downloads, and a dependency resolver written entirely in Rust. Once a package is cached locally, subsequent installs are near-instant — even across different projects.
Want to build a strong foundation in Python from package management and virtual environments to data science and machine learning workflows with structured guidance and real projects? Check out HCL GUVI’s Python Programming Course designed for students and professionals who want to go from beginner to job-ready Python developer.
Installing uv
uv ships as a single standalone binary with no dependencies. The recommended installation method on macOS and Linux is the official installer script. On Windows, a PowerShell command handles the same task.
| # macOS and Linux curl -LsSf https://astral.sh/uv/install.sh | sh # Windows (PowerShell) powershell -ExecutionPolicy ByPass -c “irm https://astral.sh/uv/install.ps1 | iex” # Or via pip (if you already have Python) pip install uv # Verify installation uv –version |
uv self-updates automatically when a new version is released. You do not need to manage the uv binary through pip or any other package manager — it handles itself.
Core Workflow: From Project Init to Running Code
A typical uv project workflow replaces the old sequence of python -m venv, pip install, pip freeze, and manual activation with four clean commands.
Starting a New Project
| # Create a new project with pyproject.toml uv init my-project cd my-project # Add dependencies — updates pyproject.toml and installs uv add numpy pandas scikit-learn # Add a dev-only dependency uv add –dev pytest ruff # Generate a lock file (pins exact versions) uv lock # Sync the environment to match the lock file exactly uv sync # Run a script inside the managed environment uv run python main.py |
Working with an Existing pip Project
| # Create a virtual environment uv venv # Install from requirements.txt (drop-in for pip install -r) uv pip install -r requirements.txt # Install a single package uv pip install requests # Compile requirements.in to a pinned requirements.txt uv pip compile requirements.in -o requirements.txt # Sync environment to a lock file (removes unlisted packages) uv pip sync requirements.txt |
Managing Python Versions with uv
One of uv’s most powerful features beyond pip replacement is built-in Python version management. Previously this required pyenv — a separate tool with its own installation process and shell integration. uv handles it natively.
| # List available Python versions uv python list # Install a specific Python version uv python install 3.12 uv python install 3.11 3.10 # install multiple at once # Pin a project to a specific Python version uv python pin 3.12 # Create a venv with a specific Python version uv venv –python 3.11 |
uv, the modern Python package and project manager developed by :contentReference[oaicite:0]{index=0}, was released in February 2024 and rapidly became one of the fastest-adopted developer tools in the Python ecosystem, reaching massive daily download volumes within its first year. Designed as a high-performance alternative to traditional tooling like pip, uv focuses heavily on speed and reproducibility. In published benchmarks, it demonstrates significant performance improvements in dependency installation workflows—for example, installing packages such as Trio several times faster than pip in warm-cache scenarios and dramatically faster in cold-cache conditions. This performance-first design has made uv increasingly popular among Python developers working with large projects and CI/CD pipelines.
Running Scripts and Tools with uv run
uv run executes a Python script inside its managed environment without requiring manual activation. More powerfully, uv supports inline script dependencies — PEP 723 metadata embedded at the top of a .py file that declares exactly which packages that script needs. uv reads this metadata, installs the dependencies into a temporary isolated environment, runs the script, then discards the environment.
| # /// script # requires-python = “>=3.11” # dependencies = [ # “requests”, # “rich”, # ] # /// import requests from rich import print data = requests.get(‘https://api.github.com’).json() print(data) |
| # Run the script — uv handles the environment automatically uv run fetch_github.py |
This is particularly useful for standalone utility scripts, data ingestion jobs, and automation tasks that need specific package versions without polluting your main project environment.
Read More: Top Python Libraries for Data Science
Real-World Use Cases
uv fits naturally into every stage of the Python development lifecycle — from a student’s first project to a production ML pipeline.
• Data science and ML pipelines: Use uv to lock exact NumPy, pandas, and scikit-learn versions across your team so every developer and CI runner uses identical environments with a single uv sync command.
• CI/CD speed: Replace pip install in GitHub Actions or GitLab CI with uv pip sync. The global cache layer means repeated runs skip re-downloading packages that have not changed, cutting pipeline time dramatically.
• Standalone automation scripts: Embed inline dependencies with PEP 723 metadata and distribute a single .py file that uv run can execute anywhere with no manual setup.
• Teaching and onboarding: New developers can go from a fresh machine to a running project with two commands — uv sync and uv run — eliminating the virtualenv activation confusion that trips up most beginners.
Common Mistakes When Switching to uv
1. Forgetting to use uv run instead of python: If you activate the uv-managed .venv manually and call python directly, you bypass uv’s environment management. Use uv run consistently to ensure the correct Python version and dependencies are always active.
2. Mixing uv and pip in the same project: Running pip install inside a uv-managed project can install packages outside the lock file, causing reproducibility issues. Commit to uv add and uv pip install exclusively within a project.
3. Not committing uv.lock: The uv.lock file is what guarantees every developer and CI runner uses identical package versions. It should always be committed to version control — treat it like package-lock.json in Node.js projects.
4. Expecting uv to replace conda for scientific stacks: uv installs pure Python and binary wheel packages from PyPI. It does not manage non-Python dependencies like CUDA libraries or system-level C extensions the way conda does. For heavy scientific computing with custom CUDA builds, conda or mamba may still be needed alongside uv.
Conclusion
uv is the most significant shift in Python tooling in a decade. It collapses four separate tools — pip, pip-tools, virtualenv, and pyenv into a single Rust-powered binary that is 10 to 100 times faster than the tools it replaces. The workflow is cleaner: uv init to start, uv add to manage dependencies, uv lock to pin versions, uv sync to reproduce the environment exactly, and uv run to execute code. Whether you are a student setting up your first Python project or an engineering team maintaining production ML pipelines, uv removes the friction that has made Python packaging frustrating for years. The best way to start is to install uv today and run uv pip install on your next project instead of pip
FAQs
1. What is uv in Python?
uv is an extremely fast Python package and project manager written in Rust, created by Astral. It is a single binary that replaces pip, pip-tools, virtualenv, and pyenv. It installs packages 10 to 100 times faster than pip through a global cache, parallel downloads, and a Rust-based dependency resolver.
2. Is uv a drop-in replacement for pip?
Yes. uv pip install, uv pip uninstall, uv pip freeze, and uv pip compile are direct equivalents of their pip and pip-tools counterparts. You can switch an existing project from pip to uv without changing your requirements.txt or pyproject.toml structure.
3. How does uv compare to pip in speed?
In benchmark tests by Astral, uv installs packages 8× faster than pip with a warm cache and up to 80× faster with a cold cache. The speed comes from three sources: a content-addressed global package cache shared across all projects, parallel HTTP downloads, and a dependency resolver written in Rust using the PubGrub algorithm.
4. Does uv replace conda?
Not entirely. uv installs Python packages from PyPI, including binary wheels. It does not manage non-Python system dependencies, custom CUDA builds, or the conda-forge package ecosystem. For pure Python and standard scientific packages (NumPy, pandas, scikit-learn), uv is fully capable
5. What is a uv.lock file?
uv.lock is a cross-platform lock file generated by uv lock. It records the exact version, source, and hash of every package in the dependency tree, direct and transitive. Committing uv.lock to version control guarantees that every developer and CI runner installs identical environments via uv sync.
6. What is uv run used for?
uv run executes a Python script or command inside the uv-managed virtual environment without manual activation. It also supports PEP 723 inline script dependencies metadata embedded in the script file that declares which packages it needs. uv reads this, creates a temporary isolated environment, runs the script, and discards the environment automatically.
7. Can uv manage Python versions like pyenv?
Yes. uv python install 3.12 downloads and installs a specific Python version. uv python pin 3.12 pins the current project to that version. uv python list shows all available and installed versions. This replaces pyenv for most use cases without any shell integration or .python-version file conflicts.



Did you enjoy this article?