LinuxCommandLibrary

uv-pip

Install Python packages

TLDR

Install a package

$ uv pip install [package]
copy

Install packages from a requirements file
$ uv pip install [[-r|--requirements]] [requirements.txt]
copy

Install a package with a specific version
$ uv pip install [package==1.2.3]
copy

Uninstall a package
$ uv pip uninstall [package]
copy

Lock dependencies from pyproject.toml to requirements.txt
$ uv pip compile pyproject.toml [[-o|--output-file]] requirements.txt
copy

List installed packages
$ uv pip list
copy

Show information about an installed package
$ uv pip show [package]
copy

Sync environment with a requirements file (install/uninstall to match exactly)
$ uv pip sync [requirements.txt]
copy

SYNOPSIS

uv pip <SUBCOMMAND> [OPTIONS] [ARGS]
Common: uv pip install [OPTIONS] PACKAGE...

PARAMETERS

--upgrade
    Upgrade packages to latest compatible versions

--force-reinstall
    Reinstall packages even if up-to-date

--no-deps
    Ignore package dependencies

--index-url <URL>
    Base URL for package index (PyPI default)

--extra-index-url <URL>
    Additional index URL to search

--python <PYTHON>
    Python interpreter or version to use

--system
    Install to system Python (requires --break-system-packages)

--target <DIR>
    Install to a directory

-e, --editable <PATH>
    Install in editable mode from path

--requirement <FILE>
    Install from requirements file

--dry-run
    Simulate the installation without changes

--verbose
    Enable verbose logging

--quiet
    Reduce output verbosity

DESCRIPTION

uv pip is a subcommand of the uv tool, an extremely fast Python package and project manager written in Rust by Astral. It serves as a drop-in replacement for the standard pip command, offering 10-100x speed improvements for installing, upgrading, and managing Python packages. uv pip maintains near-complete compatibility with pip's command-line interface and options, allowing seamless migration without changing workflows or lockfiles.

Key advantages include blazing-fast dependency resolution using a custom Rust solver, efficient wheel caching, and support for Python 3.8+. It handles complex dependency graphs effortlessly, reducing install times from minutes to seconds. uv pip integrates with uv's project management features but can operate standalone for script or environment-based installs.

Unlike pip, uv pip uses a global cache by default for reproducibility and shares it across projects. It supports editable installs, constraints files, and extras. While highly compatible, some niche pip features may lack parity, but core usage is identical. Ideal for developers seeking performance boosts without sacrificing familiarity.

CAVEATS

Not 100% pip-compatible; some advanced features like certain wheel builds or plugins may differ. Requires Rust toolchain for installation. Global cache can grow large without pruning.

INSTALLATION

curl -LsSf https://astral.sh/uv/install.sh | sh
Or pip install uv (slower).

SUBCOMMANDS

install, uninstall, list, freeze, check, sync, compile, cache – pip-like with uv speed.

EXAMPLES

uv pip install requests
uv pip install -r requirements.txt --upgrade
uv pip freeze > requirements.txt

HISTORY

Part of uv project by Astral, initial release February 2024. Evolved from Ruff's resolver for 10-100x pip speedups, with ongoing pip parity improvements via community feedback.

SEE ALSO

pip(1), uv(1), pip-tools(1), poetry(1)

Copied to clipboard