uv pip install installs packages into the active Python environment. It is compatible with pip install but offers significantly faster performance.
Usage
Arguments
Package Sources
Packages to install. Can be package names, URLs, file paths, or version specifications.
Install packages from requirements files.Supports:
requirements.txt.pyfiles with inline metadatapylock.tomlpyproject.toml,setup.py,setup.cfg
- to read from stdin.Install a package in editable mode from a local path.
Constraints and Overrides
Constrain package versions without requiring installation.Environment:
UV_CONSTRAINTOverride package versions, ignoring dependencies.Environment:
UV_OVERRIDEExclude packages from resolution.Environment:
UV_EXCLUDEConstrain build dependencies when building from source.Environment:
UV_BUILD_CONSTRAINTOptional Dependencies
Include optional dependencies (extras).
--all-extras
Include all optional dependencies.
Install dependency groups from
pylock.toml or pyproject.toml.Python Environment
Python interpreter to use for installation.Environment:
UV_PYTHON--system
Install into system Python instead of a virtual environment.Environment:
UV_SYSTEM_PYTHON--break-system-packages
Allow installation into externally-managed Python environments.Environment:
UV_BREAK_SYSTEM_PACKAGESInstall packages into the specified directory.
Install packages into lib, bin folders under the specified directory.
Resolver Options
-U, --upgrade
Upgrade all packages to the latest compatible versions.
Upgrade specific packages while keeping others pinned.
Resolution strategy: Environment:
highest, lowest, or lowest-direct.Default: highestUV_RESOLUTIONPre-release handling: Environment:
disallow, allow, if-necessary, explicit, or if-necessary-or-explicit.Default: if-necessary-or-explicitUV_PRERELEASEVersion selection strategy:
requires-python or fewest.Default: requires-pythonEnvironment: UV_FORK_STRATEGY--no-deps
Don’t install package dependencies.
Build Options
--no-build
Don’t build source distributions. Only use pre-built wheels.Alias for
--only-binary :all:Build specific packages from source instead of using wheels.
Only use pre-built wheels for specific packages.
Pass settings to the PEP 517 build backend.
Pass package-specific settings to build backends.
--no-build-isolation
Disable build isolation. Assumes build dependencies are already installed.Environment:
UV_NO_BUILD_ISOLATIONDisable build isolation for specific packages.
Index Options
Package indexes to use (in addition to default).Environment:
UV_INDEXDefault package index (replaces PyPI).Environment:
UV_DEFAULT_INDEXDeprecated: Use
--default-index instead.Environment: UV_INDEX_URLDeprecated: Use
--index instead.Environment: UV_EXTRA_INDEX_URLAdditional locations to search for packages.Environment:
UV_FIND_LINKS--no-index
Ignore package indexes, only use
--find-links.Index selection strategy:
first-index, unsafe-first-match, or unsafe-best-match.Default: first-indexEnvironment: UV_INDEX_STRATEGYKeyring provider for authentication:
disabled, subprocess.Default: disabledEnvironment: UV_KEYRING_PROVIDERHash Verification
--require-hashes
Require hash verification for all packages.Environment:
UV_REQUIRE_HASHES--no-verify-hashes
Disable hash verification.Environment:
UV_NO_VERIFY_HASHESVersion Constraints
Minimum Python version to support (e.g.,
3.8 or 3.8.17).Target platform triple (e.g.,
x86_64-unknown-linux-gnu).Installation Behavior
--reinstall
Reinstall all packages, ignoring existing installations.
Reinstall specific packages.
--exact
Remove extraneous packages not in requirements.
--strict
Validate environment after installation.
--dry-run
Show installation plan without installing.
Exclude packages uploaded after the specified date.Environment:
UV_EXCLUDE_NEWERExclude specific packages uploaded after dates.
Link mode for installations:
clone, copy, hardlink, symlink.Default: clone on macOS/Linux, hardlink on WindowsEnvironment: UV_LINK_MODE--compile-bytecode
Compile Python files to bytecode after installation.Environment:
UV_COMPILE_BYTECODEuv Extensions
PyTorch backend: Environment:
cpu, cu126, cu124, cu121, cu118, or auto.Preview feature. May change in future releases.
UV_TORCH_BACKEND--no-sources
Ignore
tool.uv.sources in pyproject.toml.Environment: UV_NO_SOURCESIgnore sources for specific packages.Environment:
UV_NO_SOURCES_PACKAGECache Options
--refresh
Refresh all cached data.
Refresh cached data for specific packages.
Examples
Basic Installation
From Requirements Files
Editable Installations
With Extras
Upgrade Packages
Custom Index
Local Wheels
Build from Source
Cross-Platform
Hash Verification
Dry Run
pip Compatibility
uv pip install is designed to be compatible with pip install. Most pip commands work with uv:
Differences from pip
- Performance: uv is significantly faster due to Rust implementation and parallel downloads
- Default behavior: uv requires a virtual environment by default (use
--systemto override) - Resolution: uv uses a modern dependency resolver by default
- Caching: uv has a more sophisticated caching strategy
- Index URLs: Deprecated
--index-urlin favor of--default-index
Unsupported pip Options
Most pip options are supported. Notable exceptions include:--user: Use virtual environments or--systeminstead- Some legacy pip behaviors
Related Commands
uv pip sync- Sync environment with a lockfileuv pip uninstall- Uninstall packagesuv pip list- List installed packagesuv pip freeze- Output installed packages