$linuxjunkies
>

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.

UbuntuDebianFedoraArch

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

FlagWhat it does
--versionShow the uv version and exit
-v, --verboseIncrease verbosity of output (can be repeated for more verbosity)
--quietDecrease verbosity of output
--no-cacheDisable the package cache
--python-preferencePreference order for discovering Python interpreters (explicit, managed, system)
--pythonSpecify the Python interpreter to use (version or path)
--index-urlSet the base URL for the Python package index
--no-depsSkip dependency resolution and installation
--frozenRequire lock file to exist and be up to date
--offlineDisable online functionality and rely only on the cache

Examples

Install the requests package into the current Python environment

uv pip install requests

Create a new virtual environment named 'myenv'

uv venv myenv

Install all packages listed in a requirements.txt file

uv pip install -r requirements.txt

Create or update a lock file (uv.lock) for reproducible installs

uv lock

Install packages from requirements in frozen mode, ensuring lock file is up to date

uv pip install --frozen -r requirements.txt

Download and manage Python 3.11 using uv's Python manager

uv python install 3.11

Compile a requirements.in file into a pinned requirements.txt with lock file semantics

uv pip compile requirements.in -o requirements.txt

Run a Python script with a specific Python version, creating a venv if needed

uv run --python 3.10 script.py

Related commands