uv(1)
uv is an extremely fast Python package installer and resolver written in Rust, designed as a drop-in replacement for pip and pip-tools.
Synopsis
uv [OPTIONS] COMMAND [ARGS]...Description
uv provides a blazingly fast alternative to traditional Python package management tools like pip, pip-tools, and venv. It handles package installation, virtual environment creation, dependency resolution, and Python version management with significant performance improvements.
The tool is designed for both interactive use and CI/CD pipelines, supporting lock files, reproducible installs, and project management workflows. It can be used as a drop-in replacement for pip in most scenarios while offering additional features for professional Python development.
Common options
| Flag | What it does |
|---|---|
--version | Show the uv version and exit |
-v, --verbose | Increase verbosity of output (can be repeated for more verbosity) |
--quiet | Decrease verbosity of output |
--no-cache | Disable the package cache |
--python-preference | Preference order for discovering Python interpreters (explicit, managed, system) |
--python | Specify the Python interpreter to use (version or path) |
--index-url | Set the base URL for the Python package index |
--no-deps | Skip dependency resolution and installation |
--frozen | Require lock file to exist and be up to date |
--offline | Disable online functionality and rely only on the cache |
Examples
Install the requests package into the current Python environment
uv pip install requestsCreate a new virtual environment named 'myenv'
uv venv myenvInstall all packages listed in a requirements.txt file
uv pip install -r requirements.txtCreate or update a lock file (uv.lock) for reproducible installs
uv lockInstall packages from requirements in frozen mode, ensuring lock file is up to date
uv pip install --frozen -r requirements.txtDownload and manage Python 3.11 using uv's Python manager
uv python install 3.11Compile a requirements.in file into a pinned requirements.txt with lock file semantics
uv pip compile requirements.in -o requirements.txtRun a Python script with a specific Python version, creating a venv if needed
uv run --python 3.10 script.py