What is Python UV?
UV is a fast, modern Python package manager written in Rust. It’s designed as a drop-in replacement forpip, pip-tools, and other package managers, offering significantly better performance (10–100x faster than pip) while maintaining compatibility with the Python ecosystem.
Key Features:
- Run Scripts — execute scripts within project environments
- Python version management — install and switch between Python versions
- Speed — 10–100x faster than pip
- Dependency management — lock files and reproducible environments
Installation
For more installation options, refer to the official documentation.Standalone installer
PyPI
uv is also available on PyPI:
Shell Autocompletion
After installing UV, set up shell autocompletion for a better user experience.Tool Management and Verification
Verify the installed version:Modern UV Project Workflow
This workflow usesuv to create and manage a new Python project from scratch.
The
uv init command sets up a new UV project by creating standard metadata files such as pyproject.toml and .python-version.The
uv venv command creates an isolated virtual environment named .venv within the project directory.Install packages with
uv add. This updates pyproject.toml, resolves the dependency graph, and installs packages into the virtual environment.Command Equivalency
For developers transitioning frompip and venv to uv:
| pip | uv |
|---|---|
python -m venv .venv | uv venv |
pip install <package> | uv add <package> |
pip install -r requirements.txt | uv add -r requirements.txt |
pip freeze > requirements.txt | uv export -o requirements.txt |
pip list | uv tree |
pip uninstall <package> | uv remove <package> |
Direct installation with uv pip install
uv also supports the traditional pip install interface:
Managing Python Versions
uv will detect and use the system Python by default. You can also install and manage multiple Python versions:
uv automatically adds the installed Python version to your PATH: