Skip to main content
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

package
string[]
Packages to install. Can be package names, URLs, file paths, or version specifications.
-r, --requirements
path[]
Install packages from requirements files.Supports:
  • requirements.txt
  • .py files with inline metadata
  • pylock.toml
  • pyproject.toml, setup.py, setup.cfg
Use - to read from stdin.
-e, --editable
string[]
Install a package in editable mode from a local path.

Constraints and Overrides

-c, --constraint
path[]
Constrain package versions without requiring installation.
Environment: UV_CONSTRAINT
--override
path[]
Override package versions, ignoring dependencies.
Environment: UV_OVERRIDE
--exclude
path[]
Exclude packages from resolution.
Environment: UV_EXCLUDE
-B, --build-constraint
path[]
Constrain build dependencies when building from source.
Environment: UV_BUILD_CONSTRAINT

Optional Dependencies

--extra
string[]
Include optional dependencies (extras).
--all-extras
Include all optional dependencies.
--group
string[]
Install dependency groups from pylock.toml or pyproject.toml.

Python Environment

-p, --python
string
Python interpreter to use for installation.
Environment: UV_PYTHON
--system
Install into system Python instead of a virtual environment.
Use with caution in CI environments only. Can modify system Python installation.
Environment: UV_SYSTEM_PYTHON
--break-system-packages
Allow installation into externally-managed Python environments.
Intended for CI environments. Use with caution.
Environment: UV_BREAK_SYSTEM_PACKAGES
-t, --target
path
Install packages into the specified directory.
--prefix
path
Install packages into lib, bin folders under the specified directory.

Resolver Options

-U, --upgrade
Upgrade all packages to the latest compatible versions.
-P, --upgrade-package
requirement[]
Upgrade specific packages while keeping others pinned.
--resolution
string
Resolution strategy: highest, lowest, or lowest-direct.Default: highest
Environment: UV_RESOLUTION
--prerelease
string
Pre-release handling: disallow, allow, if-necessary, explicit, or if-necessary-or-explicit.Default: if-necessary-or-explicit
Environment: UV_PRERELEASE
--fork-strategy
string
Version 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:
--no-binary
package[]
Build specific packages from source instead of using wheels.
--only-binary
package[]
Only use pre-built wheels for specific packages.
-C, --config-setting
key=value[]
Pass settings to the PEP 517 build backend.
--config-settings-package
package:key=value[]
Pass package-specific settings to build backends.
--no-build-isolation
Disable build isolation. Assumes build dependencies are already installed.
Environment: UV_NO_BUILD_ISOLATION
--no-build-isolation-package
package[]
Disable build isolation for specific packages.

Index Options

--index
url[]
Package indexes to use (in addition to default).
Environment: UV_INDEX
--default-index
url
Default package index (replaces PyPI).
Environment: UV_DEFAULT_INDEX
-i, --index-url
url
Deprecated: Use --default-index instead.Environment: UV_INDEX_URL
--extra-index-url
url[]
Deprecated: Use --index instead.Environment: UV_EXTRA_INDEX_URL
Additional locations to search for packages.
Environment: UV_FIND_LINKS
--no-index
Ignore package indexes, only use --find-links.
--index-strategy
string
Index selection strategy: first-index, unsafe-first-match, or unsafe-best-match.Default: first-indexEnvironment: UV_INDEX_STRATEGY
--keyring-provider
string
Keyring provider for authentication: disabled, subprocess.Default: disabledEnvironment: UV_KEYRING_PROVIDER

Hash Verification

--require-hashes
Require hash verification for all packages.
Environment: UV_REQUIRE_HASHES
--no-verify-hashes
Disable hash verification.Environment: UV_NO_VERIFY_HASHES

Version Constraints

--python-version
version
Minimum Python version to support (e.g., 3.8 or 3.8.17).
--python-platform
triple
Target platform triple (e.g., x86_64-unknown-linux-gnu).
Advanced use case. May install incompatible packages.

Installation Behavior

--reinstall
Reinstall all packages, ignoring existing installations.
--reinstall-package
package[]
Reinstall specific packages.
--exact
Remove extraneous packages not in requirements.
--strict
Validate environment after installation.
--dry-run
Show installation plan without installing.
--exclude-newer
date
Exclude packages uploaded after the specified date.
Environment: UV_EXCLUDE_NEWER
--exclude-newer-package
package=date[]
Exclude 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_BYTECODE

uv Extensions

--torch-backend
string
PyTorch backend: cpu, cu126, cu124, cu121, cu118, or auto.
Preview feature. May change in future releases.
Environment: UV_TORCH_BACKEND
--no-sources
Ignore tool.uv.sources in pyproject.toml.Environment: UV_NO_SOURCES
--no-sources-package
package[]
Ignore sources for specific packages.Environment: UV_NO_SOURCES_PACKAGE

Cache Options

--refresh
Refresh all cached data.
--refresh-package
package[]
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

  1. Performance: uv is significantly faster due to Rust implementation and parallel downloads
  2. Default behavior: uv requires a virtual environment by default (use --system to override)
  3. Resolution: uv uses a modern dependency resolver by default
  4. Caching: uv has a more sophisticated caching strategy
  5. Index URLs: Deprecated --index-url in favor of --default-index

Unsupported pip Options

Most pip options are supported. Notable exceptions include:
  • --user: Use virtual environments or --system instead
  • Some legacy pip behaviors