# CLI Reference ## uv An extremely fast Python package manager.
uv run
Run a command or script (experimental)
uv init
Create a new project (experimental)
uv add
Add dependencies to the project (experimental)
uv remove
Remove dependencies from the project (experimental)
uv sync
Update the project’s environment (experimental)
uv lock
Update the project’s lockfile (experimental)
uv tree
Display the project’s dependency tree (experimental)
uv tool
Run and manage tools provided by Python packages (experimental)
uv python
Manage Python versions and installations (experimental)
uv pip
Manage Python packages with a pip-compatible interface
uv venv
Create a virtual environment
uv cache
Manage uv’s cache
uv version
Display uv’s version
uv help
Display documentation for a command
--extra
extraInclude optional dependencies from the extra group name.
May be provided more than once.
Optional dependencies are defined via project.optional-dependencies
in a pyproject.toml
.
This option is only available when running in a project.
--with
withRun with the given packages installed.
When used in a project, these dependencies will be layered on top of the project environment in a separate, ephemeral environment. These dependencies are allowed to conflict with those specified by the project.
--with-requirements
with-requirementsRun with all packages listed in the given requirements.txt
files.
The same environment semantics as --with
apply.
Using pyproject.toml
, setup.py
, or setup.cfg
files is not allowed.
--index-url
, -i
index-urlThe URL of the Python package index (by default: <https://pypi.org/simple>).
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url
flag.
--extra-index-url
extra-index-urlExtra URLs of package indexes to use, in addition to --index-url
.
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
All indexes provided via this flag take priority over the index specified by --index-url
(which defaults to PyPI). When multiple --extra-index-url
flags are provided, earlier values take priority.
--find-links
, -f
find-linksLocations to search for candidate distributions, in addition to those found in the registry indexes.
If a path, the target must be a directory that contains packages as wheel files (.whl
) or source distributions (.tar.gz
or .zip
) at the top level.
If a URL, the page must contain a flat list of links to package files adhering to the formats described above.
--upgrade-package
, -P
upgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-package
reinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies --refresh-package
--index-strategy
index-strategyThe strategy to use when resolving against multiple index URLs.
By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match
). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.
Possible values:
first-index
: Only use results from the first index that returns a match for a given package nameunsafe-first-match
: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match
: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index--keyring-provider
keyring-providerAttempt to use keyring
for authentication for index URLs.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--resolution
resolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (highest
).
Possible values:
highest
: Resolve the highest compatible version of each packagelowest
: Resolve the lowest compatible version of each packagelowest-direct
: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies--prerelease
prereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit
).
Possible values:
disallow
: Disallow all pre-release versionsallow
: Allow all pre-release versionsif-necessary
: Allow pre-release versions if all versions of a package are pre-releaseexplicit
: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit
: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements--config-setting
, -C
config-settingSettings to pass to the PEP 517 build backend, specified as KEY=VALUE
pairs
--exclude-newer
exclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z
) and UTC dates in the same format (e.g., 2006-12-02
).
--link-mode
link-modeThe method to use when installing packages from the global cache.
Defaults to clone
(also known as Copy-on-Write) on macOS, and hardlink
on Linux and Windows.
Possible values:
clone
: Clone (i.e., copy-on-write) packages from the wheel into the site-packages
directorycopy
: Copy packages from the wheel into the site-packages
directoryhardlink
: Hard link packages from the wheel into the site-packages
directorysymlink
: Symbolically link packages from the wheel into the site-packages
directory--no-build-package
no-build-packageDon’t build source distributions for a specific package
--no-binary-package
no-binary-packageDon’t install pre-built wheels for a specific package
--refresh-package
refresh-packageRefresh cached data for a specific package
--package
packageRun the command in a specific package in the workspace.
If not in a workspace, or if the workspace member does not exist, uv will exit with an error.
--python
, -p
pythonThe Python interpreter to use for the run environment.
If the interpreter request is satisfied by a discovered environment, the environment will be used.
See uv python to view supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
PATH
The path to use for the project.
Defaults to the current working directory. Accepts relative and absolute paths.
If a pyproject.toml
is found in any of the parent directories of the target path, the project will be added as a workspace member of the parent, unless --no-workspace
is provided.
--name
nameThe name of the project.
Defaults to the name of the directory.
--python
, -p
pythonThe Python interpreter to use to determine the minimum supported Python version.
See uv python to view supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
REQUIREMENTS
The packages to add, as PEP 508 requirements (e.g., ruff==0.5.0
)
--optional
optionalAdd the requirements to the specified optional dependency group
--rev
revSpecific commit to use when adding from Git
--tag
tagTag to use when adding from git
--branch
branchBranch to use when adding from git
--extra
extraExtras to activate for the dependency; may be provided more than once
--index-url
, -i
index-urlThe URL of the Python package index (by default: <https://pypi.org/simple>).
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url
flag.
--extra-index-url
extra-index-urlExtra URLs of package indexes to use, in addition to --index-url
.
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
All indexes provided via this flag take priority over the index specified by --index-url
(which defaults to PyPI). When multiple --extra-index-url
flags are provided, earlier values take priority.
--find-links
, -f
find-linksLocations to search for candidate distributions, in addition to those found in the registry indexes.
If a path, the target must be a directory that contains packages as wheel files (.whl
) or source distributions (.tar.gz
or .zip
) at the top level.
If a URL, the page must contain a flat list of links to package files adhering to the formats described above.
--upgrade-package
, -P
upgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-package
reinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies --refresh-package
--index-strategy
index-strategyThe strategy to use when resolving against multiple index URLs.
By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match
). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.
Possible values:
first-index
: Only use results from the first index that returns a match for a given package nameunsafe-first-match
: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match
: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index--keyring-provider
keyring-providerAttempt to use keyring
for authentication for index URLs.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--resolution
resolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (highest
).
Possible values:
highest
: Resolve the highest compatible version of each packagelowest
: Resolve the lowest compatible version of each packagelowest-direct
: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies--prerelease
prereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit
).
Possible values:
disallow
: Disallow all pre-release versionsallow
: Allow all pre-release versionsif-necessary
: Allow pre-release versions if all versions of a package are pre-releaseexplicit
: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit
: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements--config-setting
, -C
config-settingSettings to pass to the PEP 517 build backend, specified as KEY=VALUE
pairs
--exclude-newer
exclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z
) and UTC dates in the same format (e.g., 2006-12-02
).
--link-mode
link-modeThe method to use when installing packages from the global cache.
Defaults to clone
(also known as Copy-on-Write) on macOS, and hardlink
on Linux and Windows.
Possible values:
clone
: Clone (i.e., copy-on-write) packages from the wheel into the site-packages
directorycopy
: Copy packages from the wheel into the site-packages
directoryhardlink
: Hard link packages from the wheel into the site-packages
directorysymlink
: Symbolically link packages from the wheel into the site-packages
directory--no-build-package
no-build-packageDon’t build source distributions for a specific package
--no-binary-package
no-binary-packageDon’t install pre-built wheels for a specific package
--refresh-package
refresh-packageRefresh cached data for a specific package
--package
packageAdd the dependency to a specific package in the workspace
--python
, -p
pythonThe Python interpreter to use for resolving and syncing.
See uv python for details on Python discovery and supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
REQUIREMENTS
The names of the packages to remove (e.g., ruff
)
--optional
optionalRemove the requirements from the specified optional dependency group
--index-url
, -i
index-urlThe URL of the Python package index (by default: <https://pypi.org/simple>).
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url
flag.
--extra-index-url
extra-index-urlExtra URLs of package indexes to use, in addition to --index-url
.
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
All indexes provided via this flag take priority over the index specified by --index-url
(which defaults to PyPI). When multiple --extra-index-url
flags are provided, earlier values take priority.
--find-links
, -f
find-linksLocations to search for candidate distributions, in addition to those found in the registry indexes.
If a path, the target must be a directory that contains packages as wheel files (.whl
) or source distributions (.tar.gz
or .zip
) at the top level.
If a URL, the page must contain a flat list of links to package files adhering to the formats described above.
--upgrade-package
, -P
upgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-package
reinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies --refresh-package
--index-strategy
index-strategyThe strategy to use when resolving against multiple index URLs.
By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match
). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.
Possible values:
first-index
: Only use results from the first index that returns a match for a given package nameunsafe-first-match
: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match
: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index--keyring-provider
keyring-providerAttempt to use keyring
for authentication for index URLs.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--resolution
resolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (highest
).
Possible values:
highest
: Resolve the highest compatible version of each packagelowest
: Resolve the lowest compatible version of each packagelowest-direct
: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies--prerelease
prereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit
).
Possible values:
disallow
: Disallow all pre-release versionsallow
: Allow all pre-release versionsif-necessary
: Allow pre-release versions if all versions of a package are pre-releaseexplicit
: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit
: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements--config-setting
, -C
config-settingSettings to pass to the PEP 517 build backend, specified as KEY=VALUE
pairs
--exclude-newer
exclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z
) and UTC dates in the same format (e.g., 2006-12-02
).
--link-mode
link-modeThe method to use when installing packages from the global cache.
Defaults to clone
(also known as Copy-on-Write) on macOS, and hardlink
on Linux and Windows.
Possible values:
clone
: Clone (i.e., copy-on-write) packages from the wheel into the site-packages
directorycopy
: Copy packages from the wheel into the site-packages
directoryhardlink
: Hard link packages from the wheel into the site-packages
directorysymlink
: Symbolically link packages from the wheel into the site-packages
directory--no-build-package
no-build-packageDon’t build source distributions for a specific package
--no-binary-package
no-binary-packageDon’t install pre-built wheels for a specific package
--refresh-package
refresh-packageRefresh cached data for a specific package
--package
packageRemove the dependency from a specific package in the workspace
--python
, -p
pythonThe Python interpreter to use for resolving and syncing.
See uv python for details on Python discovery and supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--extra
extraInclude optional dependencies from the extra group name; may be provided more than once.
Only applies to pyproject.toml
, setup.py
, and setup.cfg
sources.
--index-url
, -i
index-urlThe URL of the Python package index (by default: <https://pypi.org/simple>).
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url
flag.
--extra-index-url
extra-index-urlExtra URLs of package indexes to use, in addition to --index-url
.
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
All indexes provided via this flag take priority over the index specified by --index-url
(which defaults to PyPI). When multiple --extra-index-url
flags are provided, earlier values take priority.
--find-links
, -f
find-linksLocations to search for candidate distributions, in addition to those found in the registry indexes.
If a path, the target must be a directory that contains packages as wheel files (.whl
) or source distributions (.tar.gz
or .zip
) at the top level.
If a URL, the page must contain a flat list of links to package files adhering to the formats described above.
--upgrade-package
, -P
upgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-package
reinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies --refresh-package
--index-strategy
index-strategyThe strategy to use when resolving against multiple index URLs.
By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match
). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.
Possible values:
first-index
: Only use results from the first index that returns a match for a given package nameunsafe-first-match
: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match
: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index--keyring-provider
keyring-providerAttempt to use keyring
for authentication for index URLs.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--resolution
resolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (highest
).
Possible values:
highest
: Resolve the highest compatible version of each packagelowest
: Resolve the lowest compatible version of each packagelowest-direct
: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies--prerelease
prereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit
).
Possible values:
disallow
: Disallow all pre-release versionsallow
: Allow all pre-release versionsif-necessary
: Allow pre-release versions if all versions of a package are pre-releaseexplicit
: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit
: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements--config-setting
, -C
config-settingSettings to pass to the PEP 517 build backend, specified as KEY=VALUE
pairs
--exclude-newer
exclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z
) and UTC dates in the same format (e.g., 2006-12-02
).
--link-mode
link-modeThe method to use when installing packages from the global cache.
Defaults to clone
(also known as Copy-on-Write) on macOS, and hardlink
on Linux and Windows.
Possible values:
clone
: Clone (i.e., copy-on-write) packages from the wheel into the site-packages
directorycopy
: Copy packages from the wheel into the site-packages
directoryhardlink
: Hard link packages from the wheel into the site-packages
directorysymlink
: Symbolically link packages from the wheel into the site-packages
directory--no-build-package
no-build-packageDon’t build source distributions for a specific package
--no-binary-package
no-binary-packageDon’t install pre-built wheels for a specific package
--refresh-package
refresh-packageRefresh cached data for a specific package
--package
packageSync a specific package in the workspace
--python
, -p
pythonThe Python interpreter to use for the project environment.
By default, the first interpreter that meets the project’s requires-python
constraint is used.
If a Python interpreter in a virtual environment is provided, the packages will not be synced to the given environment. The interpreter will be used to create a virtual environment in the project.
See uv python for details on Python discovery and supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--index-url
, -i
index-urlThe URL of the Python package index (by default: <https://pypi.org/simple>).
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url
flag.
--extra-index-url
extra-index-urlExtra URLs of package indexes to use, in addition to --index-url
.
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
All indexes provided via this flag take priority over the index specified by --index-url
(which defaults to PyPI). When multiple --extra-index-url
flags are provided, earlier values take priority.
--find-links
, -f
find-linksLocations to search for candidate distributions, in addition to those found in the registry indexes.
If a path, the target must be a directory that contains packages as wheel files (.whl
) or source distributions (.tar.gz
or .zip
) at the top level.
If a URL, the page must contain a flat list of links to package files adhering to the formats described above.
--upgrade-package
, -P
upgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--index-strategy
index-strategyThe strategy to use when resolving against multiple index URLs.
By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match
). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.
Possible values:
first-index
: Only use results from the first index that returns a match for a given package nameunsafe-first-match
: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match
: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index--keyring-provider
keyring-providerAttempt to use keyring
for authentication for index URLs.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--resolution
resolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (highest
).
Possible values:
highest
: Resolve the highest compatible version of each packagelowest
: Resolve the lowest compatible version of each packagelowest-direct
: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies--prerelease
prereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit
).
Possible values:
disallow
: Disallow all pre-release versionsallow
: Allow all pre-release versionsif-necessary
: Allow pre-release versions if all versions of a package are pre-releaseexplicit
: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit
: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements--config-setting
, -C
config-settingSettings to pass to the PEP 517 build backend, specified as KEY=VALUE
pairs
--exclude-newer
exclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z
) and UTC dates in the same format (e.g., 2006-12-02
).
--link-mode
link-modeThe method to use when installing packages from the global cache.
This option is only used when building source distributions.
Defaults to clone
(also known as Copy-on-Write) on macOS, and hardlink
on Linux and Windows.
Possible values:
clone
: Clone (i.e., copy-on-write) packages from the wheel into the site-packages
directorycopy
: Copy packages from the wheel into the site-packages
directoryhardlink
: Hard link packages from the wheel into the site-packages
directorysymlink
: Symbolically link packages from the wheel into the site-packages
directory--no-build-package
no-build-packageDon’t build source distributions for a specific package
--no-binary-package
no-binary-packageDon’t install pre-built wheels for a specific package
--refresh-package
refresh-packageRefresh cached data for a specific package
--python
, -p
pythonThe Python interpreter to use during resolution.
A Python interpreter is required for building source distributions to determine package metadata when there are not wheels.
The interpreter is also used as the fallback value for the minimum Python version if requires-python
is not set.
See uv python for details on Python discovery and supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--depth
, -d
depthMaximum display depth of the dependency tree
[default: 255]
--prune
prunePrune the given package from the display of the dependency tree
--package
packageDisplay only the specified packages
--no-build-package
no-build-packageDon’t build source distributions for a specific package
--no-binary-package
no-binary-packageDon’t install pre-built wheels for a specific package
--index-url
, -i
index-urlThe URL of the Python package index (by default: <https://pypi.org/simple>).
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url
flag.
--extra-index-url
extra-index-urlExtra URLs of package indexes to use, in addition to --index-url
.
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
All indexes provided via this flag take priority over the index specified by --index-url
(which defaults to PyPI). When multiple --extra-index-url
flags are provided, earlier values take priority.
--find-links
, -f
find-linksLocations to search for candidate distributions, in addition to those found in the registry indexes.
If a path, the target must be a directory that contains packages as wheel files (.whl
) or source distributions (.tar.gz
or .zip
) at the top level.
If a URL, the page must contain a flat list of links to package files adhering to the formats described above.
--upgrade-package
, -P
upgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--index-strategy
index-strategyThe strategy to use when resolving against multiple index URLs.
By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match
). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.
Possible values:
first-index
: Only use results from the first index that returns a match for a given package nameunsafe-first-match
: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match
: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index--keyring-provider
keyring-providerAttempt to use keyring
for authentication for index URLs.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--resolution
resolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (highest
).
Possible values:
highest
: Resolve the highest compatible version of each packagelowest
: Resolve the lowest compatible version of each packagelowest-direct
: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies--prerelease
prereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit
).
Possible values:
disallow
: Disallow all pre-release versionsallow
: Allow all pre-release versionsif-necessary
: Allow pre-release versions if all versions of a package are pre-releaseexplicit
: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit
: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements--config-setting
, -C
config-settingSettings to pass to the PEP 517 build backend, specified as KEY=VALUE
pairs
--exclude-newer
exclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z
) and UTC dates in the same format (e.g., 2006-12-02
).
--link-mode
link-modeThe method to use when installing packages from the global cache.
This option is only used when building source distributions.
Defaults to clone
(also known as Copy-on-Write) on macOS, and hardlink
on Linux and Windows.
Possible values:
clone
: Clone (i.e., copy-on-write) packages from the wheel into the site-packages
directorycopy
: Copy packages from the wheel into the site-packages
directoryhardlink
: Hard link packages from the wheel into the site-packages
directorysymlink
: Symbolically link packages from the wheel into the site-packages
directory--python-version
python-versionThe Python version to use when filtering the tree.
For example, pass --python-version 3.10
to display the dependencies that would be included when installing on Python 3.10.
Defaults to the version of the discovered Python interpreter.
--python-platform
python-platformThe platform to use when filtering the tree.
For example, pass --platform windows
to display the dependencies that would be included when installing on Windows.
Represented as a "target triple", a string that describes the target platform in terms of its CPU, vendor, and operating system name, like x86_64-unknown-linux-gnu
or aaarch64-apple-darwin
.
Possible values:
windows
: An alias for x86_64-pc-windows-msvc
, the default target for Windowslinux
: An alias for x86_64-unknown-linux-gnu
, the default target for Linuxmacos
: An alias for aarch64-apple-darwin
, the default target for macOSx86_64-pc-windows-msvc
: An x86 Windows targetx86_64-unknown-linux-gnu
: An x86 Linux target. Equivalent to x86_64-manylinux_2_17
aarch64-apple-darwin
: An ARM-based macOS target, as seen on Apple Silicon devicesx86_64-apple-darwin
: An x86 macOS targetaarch64-unknown-linux-gnu
: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_17
aarch64-unknown-linux-musl
: An ARM64 Linux targetx86_64-unknown-linux-musl
: An x86_64
Linux targetx86_64-manylinux_2_17
: An x86_64
target for the manylinux_2_17
platformx86_64-manylinux_2_28
: An x86_64
target for the manylinux_2_28
platformx86_64-manylinux_2_31
: An x86_64
target for the manylinux_2_31
platformaarch64-manylinux_2_17
: An ARM64 target for the manylinux_2_17
platformaarch64-manylinux_2_28
: An ARM64 target for the manylinux_2_28
platformaarch64-manylinux_2_31
: An ARM64 target for the manylinux_2_31
platform--python
, -p
pythonThe Python interpreter to use for locking and filtering.
By default, the tree is filtered to match the platform as reported by the Python interpreter. Use --universal
to display the tree for all platforms, or use --python-version
or --python-platform
to override a subset of markers.
See uv python for details on Python discovery and supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
uv tool run
Run a tool
uv tool install
Install a tool
uv tool list
List installed tools
uv tool uninstall
Uninstall a tool
uv tool update-shell
Ensure that the tool executable directory is on PATH
uv tool dir
Show the tools directory
--from
fromUse the given package to provide the command.
By default, the package name is assumed to match the command name.
--with
withRun with the given packages installed
--with-requirements
with-requirementsRun with all packages listed in the given requirements.txt
files
--index-url
, -i
index-urlThe URL of the Python package index (by default: <https://pypi.org/simple>).
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url
flag.
--extra-index-url
extra-index-urlExtra URLs of package indexes to use, in addition to --index-url
.
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
All indexes provided via this flag take priority over the index specified by --index-url
(which defaults to PyPI). When multiple --extra-index-url
flags are provided, earlier values take priority.
--find-links
, -f
find-linksLocations to search for candidate distributions, in addition to those found in the registry indexes.
If a path, the target must be a directory that contains packages as wheel files (.whl
) or source distributions (.tar.gz
or .zip
) at the top level.
If a URL, the page must contain a flat list of links to package files adhering to the formats described above.
--upgrade-package
, -P
upgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-package
reinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies --refresh-package
--index-strategy
index-strategyThe strategy to use when resolving against multiple index URLs.
By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match
). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.
Possible values:
first-index
: Only use results from the first index that returns a match for a given package nameunsafe-first-match
: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match
: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index--keyring-provider
keyring-providerAttempt to use keyring
for authentication for index URLs.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--resolution
resolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (highest
).
Possible values:
highest
: Resolve the highest compatible version of each packagelowest
: Resolve the lowest compatible version of each packagelowest-direct
: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies--prerelease
prereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit
).
Possible values:
disallow
: Disallow all pre-release versionsallow
: Allow all pre-release versionsif-necessary
: Allow pre-release versions if all versions of a package are pre-releaseexplicit
: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit
: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements--config-setting
, -C
config-settingSettings to pass to the PEP 517 build backend, specified as KEY=VALUE
pairs
--exclude-newer
exclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z
) and UTC dates in the same format (e.g., 2006-12-02
).
--link-mode
link-modeThe method to use when installing packages from the global cache.
Defaults to clone
(also known as Copy-on-Write) on macOS, and hardlink
on Linux and Windows.
Possible values:
clone
: Clone (i.e., copy-on-write) packages from the wheel into the site-packages
directorycopy
: Copy packages from the wheel into the site-packages
directoryhardlink
: Hard link packages from the wheel into the site-packages
directorysymlink
: Symbolically link packages from the wheel into the site-packages
directory--no-build-package
no-build-packageDon’t build source distributions for a specific package
--no-binary-package
no-binary-packageDon’t install pre-built wheels for a specific package
--refresh-package
refresh-packageRefresh cached data for a specific package
--python
, -p
pythonThe Python interpreter to use to build the run environment.
See uv python for details on Python discovery and supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
PACKAGE
The package to install commands from
--with
withInclude the following extra requirements
--with-requirements
with-requirementsRun all requirements listed in the given requirements.txt
files
--index-url
, -i
index-urlThe URL of the Python package index (by default: <https://pypi.org/simple>).
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url
flag.
--extra-index-url
extra-index-urlExtra URLs of package indexes to use, in addition to --index-url
.
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
All indexes provided via this flag take priority over the index specified by --index-url
(which defaults to PyPI). When multiple --extra-index-url
flags are provided, earlier values take priority.
--find-links
, -f
find-linksLocations to search for candidate distributions, in addition to those found in the registry indexes.
If a path, the target must be a directory that contains packages as wheel files (.whl
) or source distributions (.tar.gz
or .zip
) at the top level.
If a URL, the page must contain a flat list of links to package files adhering to the formats described above.
--upgrade-package
, -P
upgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-package
reinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies --refresh-package
--index-strategy
index-strategyThe strategy to use when resolving against multiple index URLs.
By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match
). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.
Possible values:
first-index
: Only use results from the first index that returns a match for a given package nameunsafe-first-match
: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match
: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index--keyring-provider
keyring-providerAttempt to use keyring
for authentication for index URLs.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--resolution
resolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (highest
).
Possible values:
highest
: Resolve the highest compatible version of each packagelowest
: Resolve the lowest compatible version of each packagelowest-direct
: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies--prerelease
prereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit
).
Possible values:
disallow
: Disallow all pre-release versionsallow
: Allow all pre-release versionsif-necessary
: Allow pre-release versions if all versions of a package are pre-releaseexplicit
: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit
: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements--config-setting
, -C
config-settingSettings to pass to the PEP 517 build backend, specified as KEY=VALUE
pairs
--exclude-newer
exclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z
) and UTC dates in the same format (e.g., 2006-12-02
).
--link-mode
link-modeThe method to use when installing packages from the global cache.
Defaults to clone
(also known as Copy-on-Write) on macOS, and hardlink
on Linux and Windows.
Possible values:
clone
: Clone (i.e., copy-on-write) packages from the wheel into the site-packages
directorycopy
: Copy packages from the wheel into the site-packages
directoryhardlink
: Hard link packages from the wheel into the site-packages
directorysymlink
: Symbolically link packages from the wheel into the site-packages
directory--no-build-package
no-build-packageDon’t build source distributions for a specific package
--no-binary-package
no-binary-packageDon’t install pre-built wheels for a specific package
--refresh-package
refresh-packageRefresh cached data for a specific package
--python
, -p
pythonThe Python interpreter to use to build the tool environment.
See uv python for details on Python discovery and supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
NAME
The name of the tool to uninstall
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
uv python list
List the available Python installations
uv python install
Download and install Python versions
uv python find
Search for a Python installation
uv python pin
Pin to a specific Python version
uv python dir
Show the uv Python installation directory
uv python uninstall
Uninstall Python versions
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
TARGETS
The Python version(s) to install.
If not provided, the requested Python version(s) will be read from the .python-versions
or .python-version
files. If neither file is present, uv will check if it has installed any Python versions. If not, it will install the latest stable version of Python.
See uv python to view supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
REQUEST
The Python request.
See uv python to view supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
REQUEST
The Python version request.
uv supports more formats than other tools that read .python-version
files, i.e., pyenv
. If compatibility with those tools is needed, only use version numbers instead of complex requests such as cpython@3.10
.
See uv python to view supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
TARGETS
The Python version(s) to uninstall.
See uv python to view supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
uv pip compile
Compile a requirements.in
file to a requirements.txt
file
uv pip sync
Sync an environment with a requirements.txt
file
uv pip install
Install packages into an environment
uv pip uninstall
Uninstall packages from an environment
uv pip freeze
List, in requirements format, packages installed in an environment
uv pip list
List, in tabular format, packages installed in an environment
uv pip show
Show information about one or more installed packages
uv pip tree
Display the dependency tree for an environment
uv pip check
Verify installed packages have compatible dependencies
SRC_FILE
Include all packages listed in the given requirements.in
files.
If a pyproject.toml
, setup.py
, or setup.cfg
file is provided, uv will extract the requirements for the relevant project.
If -
is provided, then requirements will be read from stdin.
--constraint
, -c
constraintConstrain versions using the given requirements files.
Constraints files are requirements.txt
-like files that only control the version of a requirement that’s installed. However, including a package in a constraints file will not trigger the installation of that package.
This is equivalent to pip’s --constraint
option.
--override
overrideOverride versions using the given requirements files.
Overrides files are requirements.txt
-like files that force a specific version of a requirement to be installed, regardless of the requirements declared by any constituent package, and regardless of whether this would be considered an invalid resolution.
While constraints are additive, in that they’re combined with the requirements of the constituent packages, overrides are absolute, in that they completely replace the requirements of the constituent packages.
--build-constraint
, -b
build-constraintConstrain build dependencies using the given requirements files when building source distributions.
Constraints files are requirements.txt
-like files that only control the version of a requirement that’s installed. However, including a package in a constraints file will not trigger the installation of that package.
--extra
extraInclude optional dependencies from the extra group name; may be provided more than once.
Only applies to pyproject.toml
, setup.py
, and setup.cfg
sources.
--index-url
, -i
index-urlThe URL of the Python package index (by default: <https://pypi.org/simple>).
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url
flag.
--extra-index-url
extra-index-urlExtra URLs of package indexes to use, in addition to --index-url
.
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
All indexes provided via this flag take priority over the index specified by --index-url
(which defaults to PyPI). When multiple --extra-index-url
flags are provided, earlier values take priority.
--find-links
, -f
find-linksLocations to search for candidate distributions, in addition to those found in the registry indexes.
If a path, the target must be a directory that contains packages as wheel files (.whl
) or source distributions (.tar.gz
or .zip
) at the top level.
If a URL, the page must contain a flat list of links to package files adhering to the formats described above.
--upgrade-package
, -P
upgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--index-strategy
index-strategyThe strategy to use when resolving against multiple index URLs.
By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match
). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.
Possible values:
first-index
: Only use results from the first index that returns a match for a given package nameunsafe-first-match
: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match
: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index--keyring-provider
keyring-providerAttempt to use keyring
for authentication for index URLs.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--resolution
resolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (highest
).
Possible values:
highest
: Resolve the highest compatible version of each packagelowest
: Resolve the lowest compatible version of each packagelowest-direct
: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies--prerelease
prereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit
).
Possible values:
disallow
: Disallow all pre-release versionsallow
: Allow all pre-release versionsif-necessary
: Allow pre-release versions if all versions of a package are pre-releaseexplicit
: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit
: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements--config-setting
, -C
config-settingSettings to pass to the PEP 517 build backend, specified as KEY=VALUE
pairs
--exclude-newer
exclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z
) and UTC dates in the same format (e.g., 2006-12-02
).
--link-mode
link-modeThe method to use when installing packages from the global cache.
This option is only used when building source distributions.
Defaults to clone
(also known as Copy-on-Write) on macOS, and hardlink
on Linux and Windows.
Possible values:
clone
: Clone (i.e., copy-on-write) packages from the wheel into the site-packages
directorycopy
: Copy packages from the wheel into the site-packages
directoryhardlink
: Hard link packages from the wheel into the site-packages
directorysymlink
: Symbolically link packages from the wheel into the site-packages
directory--refresh-package
refresh-packageRefresh cached data for a specific package
--output-file
, -o
output-fileWrite the compiled requirements to the given requirements.txt
file.
If the file already exists, the existing versions will be preferred when resolving dependencies, unless --upgrade
is also specified.
--annotation-style
annotation-styleThe style of the annotation comments included in the output file, used to indicate the source of each package.
Defaults to split
.
Possible values:
line
: Render the annotations on a single, comma-separated linesplit
: Render each annotation on its own line--custom-compile-command
custom-compile-commandThe header comment to include at the top of the output file generated by uv pip compile
.
Used to reflect custom build scripts and commands that wrap uv pip compile
.
--python
pythonThe Python interpreter to use during resolution.
A Python interpreter is required for building source distributions to determine package metadata when there are not wheels.
The interpreter is also used to determine the default minimum Python version, unless --python-version
is provided.
See uv python for details on Python discovery and supported request formats.
--no-binary
no-binaryDon’t install pre-built wheels.
The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.
Multiple packages may be provided. Disable binaries for all packages with :all:
. Clear previously specified packages with :none:
.
--only-binary
only-binaryOnly use pre-built wheels; don’t build source distributions.
When enabled, resolving will not run code from the given packages. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.
Multiple packages may be provided. Disable binaries for all packages with :all:
. Clear previously specified packages with :none:
.
--python-version
, -p
python-versionThe Python version to use for resolution.
For example, 3.8
or 3.8.17
.
Defaults to the version of the Python interpreter used for resolution.
Defines the minimum Python version that must be supported by the resolved requirements.
If a patch version is omitted, the minimum patch version is assumed. For example, 3.8
is mapped to 3.8.0
.
--python-platform
python-platformThe platform for which requirements should be resolved.
Represented as a "target triple", a string that describes the target platform in terms of its CPU, vendor, and operating system name, like x86_64-unknown-linux-gnu
or aaarch64-apple-darwin
.
Possible values:
windows
: An alias for x86_64-pc-windows-msvc
, the default target for Windowslinux
: An alias for x86_64-unknown-linux-gnu
, the default target for Linuxmacos
: An alias for aarch64-apple-darwin
, the default target for macOSx86_64-pc-windows-msvc
: An x86 Windows targetx86_64-unknown-linux-gnu
: An x86 Linux target. Equivalent to x86_64-manylinux_2_17
aarch64-apple-darwin
: An ARM-based macOS target, as seen on Apple Silicon devicesx86_64-apple-darwin
: An x86 macOS targetaarch64-unknown-linux-gnu
: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_17
aarch64-unknown-linux-musl
: An ARM64 Linux targetx86_64-unknown-linux-musl
: An x86_64
Linux targetx86_64-manylinux_2_17
: An x86_64
target for the manylinux_2_17
platformx86_64-manylinux_2_28
: An x86_64
target for the manylinux_2_28
platformx86_64-manylinux_2_31
: An x86_64
target for the manylinux_2_31
platformaarch64-manylinux_2_17
: An ARM64 target for the manylinux_2_17
platformaarch64-manylinux_2_28
: An ARM64 target for the manylinux_2_28
platformaarch64-manylinux_2_31
: An ARM64 target for the manylinux_2_31
platform--no-emit-package
no-emit-packageSpecify a package to omit from the output resolution. Its dependencies will still be included in the resolution. Equivalent to pip-compile’s --unsafe-package
option
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
SRC_FILE
Include all packages listed in the given requirements.txt
files.
If a pyproject.toml
, setup.py
, or setup.cfg
file is provided, uv will extract the requirements for the relevant project.
If -
is provided, then requirements will be read from stdin.
--constraint
, -c
constraintConstrain versions using the given requirements files.
Constraints files are requirements.txt
-like files that only control the version of a requirement that’s installed. However, including a package in a constraints file will not trigger the installation of that package.
This is equivalent to pip’s --constraint
option.
--build-constraint
, -b
build-constraintConstrain build dependencies using the given requirements files when building source distributions.
Constraints files are requirements.txt
-like files that only control the version of a requirement that’s installed. However, including a package in a constraints file will not trigger the installation of that package.
--index-url
, -i
index-urlThe URL of the Python package index (by default: <https://pypi.org/simple>).
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url
flag.
--extra-index-url
extra-index-urlExtra URLs of package indexes to use, in addition to --index-url
.
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
All indexes provided via this flag take priority over the index specified by --index-url
(which defaults to PyPI). When multiple --extra-index-url
flags are provided, earlier values take priority.
--find-links
, -f
find-linksLocations to search for candidate distributions, in addition to those found in the registry indexes.
If a path, the target must be a directory that contains packages as wheel files (.whl
) or source distributions (.tar.gz
or .zip
) at the top level.
If a URL, the page must contain a flat list of links to package files adhering to the formats described above.
--reinstall-package
reinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies --refresh-package
--index-strategy
index-strategyThe strategy to use when resolving against multiple index URLs.
By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match
). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.
Possible values:
first-index
: Only use results from the first index that returns a match for a given package nameunsafe-first-match
: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match
: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index--keyring-provider
keyring-providerAttempt to use keyring
for authentication for index URLs.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--config-setting
, -C
config-settingSettings to pass to the PEP 517 build backend, specified as KEY=VALUE
pairs
--exclude-newer
exclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z
) and UTC dates in the same format (e.g., 2006-12-02
).
--link-mode
link-modeThe method to use when installing packages from the global cache.
Defaults to clone
(also known as Copy-on-Write) on macOS, and hardlink
on Linux and Windows.
Possible values:
clone
: Clone (i.e., copy-on-write) packages from the wheel into the site-packages
directorycopy
: Copy packages from the wheel into the site-packages
directoryhardlink
: Hard link packages from the wheel into the site-packages
directorysymlink
: Symbolically link packages from the wheel into the site-packages
directory--refresh-package
refresh-packageRefresh cached data for a specific package
--python
, -p
pythonThe Python interpreter into which packages should be installed.
By default, syncing requires a virtual environment. An path to an alternative Python can be provided, but it is only recommended in continuous integration (CI) environments and should be used with caution, as it can modify the system Python installation.
See uv python for details on Python discovery and supported request formats.
--target
targetInstall packages into the specified directory, rather than into the virtual or system Python environment. The packages will be installed at the top-level of the directory
--prefix
prefixInstall packages into lib
, bin
, and other top-level folders under the specified directory, as if a virtual environment were present at that location.
In general, prefer the use of --python
to install into an alternate environment, as scripts and other artifacts installed via --prefix
will reference the installing interpreter, rather than any interpreter added to the --prefix
directory, rendering them non-portable.
--no-binary
no-binaryDon’t install pre-built wheels.
The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.
Multiple packages may be provided. Disable binaries for all packages with :all:
. Clear previously specified packages with :none:
.
--only-binary
only-binaryOnly use pre-built wheels; don’t build source distributions.
When enabled, resolving will not run code from the given packages. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.
Multiple packages may be provided. Disable binaries for all packages with :all:
. Clear previously specified packages with :none:
.
--python-version
python-versionThe minimum Python version that should be supported by the requirements (e.g., 3.7
or 3.7.9
).
If a patch version is omitted, the minimum patch version is assumed. For example, 3.7
is mapped to 3.7.0
.
--python-platform
python-platformThe platform for which requirements should be installed.
Represented as a "target triple", a string that describes the target platform in terms of its CPU, vendor, and operating system name, like x86_64-unknown-linux-gnu
or aaarch64-apple-darwin
.
WARNING: When specified, uv will select wheels that are compatible with the target platform; as a result, the installed distributions may not be compatible with the current platform. Conversely, any distributions that are built from source may be incompatible with the target platform, as they will be built for the current platform. The --python-platform
option is intended for advanced use cases.
Possible values:
windows
: An alias for x86_64-pc-windows-msvc
, the default target for Windowslinux
: An alias for x86_64-unknown-linux-gnu
, the default target for Linuxmacos
: An alias for aarch64-apple-darwin
, the default target for macOSx86_64-pc-windows-msvc
: An x86 Windows targetx86_64-unknown-linux-gnu
: An x86 Linux target. Equivalent to x86_64-manylinux_2_17
aarch64-apple-darwin
: An ARM-based macOS target, as seen on Apple Silicon devicesx86_64-apple-darwin
: An x86 macOS targetaarch64-unknown-linux-gnu
: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_17
aarch64-unknown-linux-musl
: An ARM64 Linux targetx86_64-unknown-linux-musl
: An x86_64
Linux targetx86_64-manylinux_2_17
: An x86_64
target for the manylinux_2_17
platformx86_64-manylinux_2_28
: An x86_64
target for the manylinux_2_28
platformx86_64-manylinux_2_31
: An x86_64
target for the manylinux_2_31
platformaarch64-manylinux_2_17
: An ARM64 target for the manylinux_2_17
platformaarch64-manylinux_2_28
: An ARM64 target for the manylinux_2_28
platformaarch64-manylinux_2_31
: An ARM64 target for the manylinux_2_31
platform--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
PACKAGE
Install all listed packages
--requirement
, -r
requirementInstall all packages listed in the given requirements.txt
files.
If a pyproject.toml
, setup.py
, or setup.cfg
file is provided, uv will extract the requirements for the relevant project.
If -
is provided, then requirements will be read from stdin.
--editable
, -e
editableInstall the editable package based on the provided local file path
--constraint
, -c
constraintConstrain versions using the given requirements files.
Constraints files are requirements.txt
-like files that only control the version of a requirement that’s installed. However, including a package in a constraints file will not trigger the installation of that package.
This is equivalent to pip’s --constraint
option.
--override
overrideOverride versions using the given requirements files.
Overrides files are requirements.txt
-like files that force a specific version of a requirement to be installed, regardless of the requirements declared by any constituent package, and regardless of whether this would be considered an invalid resolution.
While constraints are additive, in that they’re combined with the requirements of the constituent packages, overrides are absolute, in that they completely replace the requirements of the constituent packages.
--build-constraint
, -b
build-constraintConstrain build dependencies using the given requirements files when building source distributions.
Constraints files are requirements.txt
-like files that only control the version of a requirement that’s installed. However, including a package in a constraints file will not trigger the installation of that package.
--extra
extraInclude optional dependencies from the extra group name; may be provided more than once.
Only applies to pyproject.toml
, setup.py
, and setup.cfg
sources.
--index-url
, -i
index-urlThe URL of the Python package index (by default: <https://pypi.org/simple>).
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url
flag.
--extra-index-url
extra-index-urlExtra URLs of package indexes to use, in addition to --index-url
.
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
All indexes provided via this flag take priority over the index specified by --index-url
(which defaults to PyPI). When multiple --extra-index-url
flags are provided, earlier values take priority.
--find-links
, -f
find-linksLocations to search for candidate distributions, in addition to those found in the registry indexes.
If a path, the target must be a directory that contains packages as wheel files (.whl
) or source distributions (.tar.gz
or .zip
) at the top level.
If a URL, the page must contain a flat list of links to package files adhering to the formats described above.
--upgrade-package
, -P
upgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-package
reinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies --refresh-package
--index-strategy
index-strategyThe strategy to use when resolving against multiple index URLs.
By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match
). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.
Possible values:
first-index
: Only use results from the first index that returns a match for a given package nameunsafe-first-match
: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match
: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index--keyring-provider
keyring-providerAttempt to use keyring
for authentication for index URLs.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--resolution
resolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (highest
).
Possible values:
highest
: Resolve the highest compatible version of each packagelowest
: Resolve the lowest compatible version of each packagelowest-direct
: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies--prerelease
prereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit
).
Possible values:
disallow
: Disallow all pre-release versionsallow
: Allow all pre-release versionsif-necessary
: Allow pre-release versions if all versions of a package are pre-releaseexplicit
: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit
: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements--config-setting
, -C
config-settingSettings to pass to the PEP 517 build backend, specified as KEY=VALUE
pairs
--exclude-newer
exclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z
) and UTC dates in the same format (e.g., 2006-12-02
).
--link-mode
link-modeThe method to use when installing packages from the global cache.
Defaults to clone
(also known as Copy-on-Write) on macOS, and hardlink
on Linux and Windows.
Possible values:
clone
: Clone (i.e., copy-on-write) packages from the wheel into the site-packages
directorycopy
: Copy packages from the wheel into the site-packages
directoryhardlink
: Hard link packages from the wheel into the site-packages
directorysymlink
: Symbolically link packages from the wheel into the site-packages
directory--refresh-package
refresh-packageRefresh cached data for a specific package
--python
, -p
pythonThe Python interpreter into which packages should be installed.
By default, installation requires a virtual environment. An path to an alternative Python can be provided, but it is only recommended in continuous integration (CI) environments and should be used with caution, as it can modify the system Python installation.
See uv python for details on Python discovery and supported request formats.
--target
targetInstall packages into the specified directory, rather than into the virtual or system Python environment. The packages will be installed at the top-level of the directory
--prefix
prefixInstall packages into lib
, bin
, and other top-level folders under the specified directory, as if a virtual environment were present at that location.
In general, prefer the use of --python
to install into an alternate environment, as scripts and other artifacts installed via --prefix
will reference the installing interpreter, rather than any interpreter added to the --prefix
directory, rendering them non-portable.
--no-binary
no-binaryDon’t install pre-built wheels.
The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.
Multiple packages may be provided. Disable binaries for all packages with :all:
. Clear previously specified packages with :none:
.
--only-binary
only-binaryOnly use pre-built wheels; don’t build source distributions.
When enabled, resolving will not run code from the given packages. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.
Multiple packages may be provided. Disable binaries for all packages with :all:
. Clear previously specified packages with :none:
.
--python-version
python-versionThe minimum Python version that should be supported by the requirements (e.g., 3.7
or 3.7.9
).
If a patch version is omitted, the minimum patch version is assumed. For example, 3.7
is mapped to 3.7.0
.
--python-platform
python-platformThe platform for which requirements should be installed.
Represented as a "target triple", a string that describes the target platform in terms of its CPU, vendor, and operating system name, like x86_64-unknown-linux-gnu
or aaarch64-apple-darwin
.
WARNING: When specified, uv will select wheels that are compatible with the target platform; as a result, the installed distributions may not be compatible with the current platform. Conversely, any distributions that are built from source may be incompatible with the target platform, as they will be built for the current platform. The --python-platform
option is intended for advanced use cases.
Possible values:
windows
: An alias for x86_64-pc-windows-msvc
, the default target for Windowslinux
: An alias for x86_64-unknown-linux-gnu
, the default target for Linuxmacos
: An alias for aarch64-apple-darwin
, the default target for macOSx86_64-pc-windows-msvc
: An x86 Windows targetx86_64-unknown-linux-gnu
: An x86 Linux target. Equivalent to x86_64-manylinux_2_17
aarch64-apple-darwin
: An ARM-based macOS target, as seen on Apple Silicon devicesx86_64-apple-darwin
: An x86 macOS targetaarch64-unknown-linux-gnu
: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_17
aarch64-unknown-linux-musl
: An ARM64 Linux targetx86_64-unknown-linux-musl
: An x86_64
Linux targetx86_64-manylinux_2_17
: An x86_64
target for the manylinux_2_17
platformx86_64-manylinux_2_28
: An x86_64
target for the manylinux_2_28
platformx86_64-manylinux_2_31
: An x86_64
target for the manylinux_2_31
platformaarch64-manylinux_2_17
: An ARM64 target for the manylinux_2_17
platformaarch64-manylinux_2_28
: An ARM64 target for the manylinux_2_28
platformaarch64-manylinux_2_31
: An ARM64 target for the manylinux_2_31
platform--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
PACKAGE
Uninstall all listed packages
--requirement
, -r
requirementUninstall all packages listed in the given requirements files
--python
, -p
pythonThe Python interpreter from which packages should be uninstalled.
By default, uninstallation requires a virtual environment. An path to an alternative Python can be provided, but it is only recommended in continuous integration (CI) environments and should be used with caution, as it can modify the system Python installation.
See uv python for details on Python discovery and supported request formats.
--keyring-provider
keyring-providerAttempt to use keyring
for authentication for remote requirements files.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--target
targetUninstall packages from the specified --target
directory
--prefix
prefixUninstall packages from the specified --prefix
directory
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--python
, -p
pythonThe Python interpreter for which packages should be listed.
By default, uv lists packages in a virtual environment but will show packages in a system Python environment if no virtual environment is found.
See uv python for details on Python discovery and supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--exclude
excludeExclude the specified package(s) from the output
--format
formatSelect the output format between: columns
(default), freeze
, or json
[default: columns]
Possible values:
columns
: Display the list of packages in a human-readable tablefreeze
: Display the list of packages in a pip freeze
-like format, with one package per line alongside its versionjson
: Display the list of packages in a machine-readable JSON format--python
, -p
pythonThe Python interpreter for which packages should be listed.
By default, uv lists packages in a virtual environment but will show packages in a system Python environment if no virtual environment is found.
See uv python for details on Python discovery and supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
PACKAGE
The package(s) to display
--python
, -p
pythonThe Python interpreter to find the package in.
By default, uv looks for packages in a virtual environment but will look for packages in a system Python environment if no virtual environment is found.
See uv python for details on Python discovery and supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--depth
, -d
depthMaximum display depth of the dependency tree
[default: 255]
--prune
prunePrune the given package from the display of the dependency tree
--package
packageDisplay only the specified packages
--python
, -p
pythonThe Python interpreter for which packages should be listed.
By default, uv lists packages in a virtual environment but will show packages in a system Python environment if no virtual environment is found.
See uv python for details on Python discovery and supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--python
, -p
pythonThe Python interpreter for which packages should be checked.
By default, uv checks packages in a virtual environment but will check packages in a system Python environment if no virtual environment is found.
See uv python for details on Python discovery and supported request formats.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
NAME
The path to the virtual environment to create
--python
, -p
pythonThe Python interpreter to use for the virtual environment.
During virtual environment creation, uv will not look for Python interpreters in virtual environments.
See uv python help
for details on Python discovery and supported request formats.
--prompt
promptProvide an alternative prompt prefix for the virtual environment.
The default behavior depends on whether the virtual environment path is provided:
uv venv project
), the prompt is set to the virtual environment’s directory name.uv venv
), the prompt is set to the current directory’s name.Possible values:
.
: Use the current directory name.--index-url
, -i
index-urlThe URL of the Python package index (by default: <https://pypi.org/simple>).
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url
flag.
--extra-index-url
extra-index-urlExtra URLs of package indexes to use, in addition to --index-url
.
Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.
All indexes provided via this flag take priority over the index specified by --index-url
(which defaults to PyPI). When multiple --extra-index-url
flags are provided, earlier values take priority.
--find-links
, -f
find-linksLocations to search for candidate distributions, in addition to those found in the registry indexes.
If a path, the target must be a directory that contains packages as wheel files (.whl
) or source distributions (.tar.gz
or .zip
) at the top level.
If a URL, the page must contain a flat list of links to package files adhering to the formats described above.
--index-strategy
index-strategyThe strategy to use when resolving against multiple index URLs.
By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match
). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.
Possible values:
first-index
: Only use results from the first index that returns a match for a given package nameunsafe-first-match
: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match
: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index--keyring-provider
keyring-providerAttempt to use keyring
for authentication for index URLs.
At present, only --keyring-provider subprocess
is supported, which configures uv to use the keyring
CLI to handle authentication.
Defaults to disabled
.
Possible values:
disabled
: Do not use keyring for credential lookupsubprocess
: Use the keyring
command for credential lookup--exclude-newer
exclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z
) and UTC dates in the same format (e.g., 2006-12-02
).
--link-mode
link-modeThe method to use when installing packages from the global cache.
This option is only used for installing seed packages.
Defaults to clone
(also known as Copy-on-Write) on macOS, and hardlink
on Linux and Windows.
Possible values:
clone
: Clone (i.e., copy-on-write) packages from the wheel into the site-packages
directorycopy
: Copy packages from the wheel into the site-packages
directoryhardlink
: Hard link packages from the wheel into the site-packages
directorysymlink
: Symbolically link packages from the wheel into the site-packages
directory--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
uv cache clean
Clear the cache, removing all entries or those linked to specific packages
uv cache prune
Prune all unreachable objects from the cache
uv cache dir
Show the cache directory
PACKAGE
The packages to remove from the cache
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
--output-format
output-format--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.
COMMAND
--cache-dir
cache-dirPath to the cache directory.
Defaults to $HOME/Library/Caches/uv
on macOS, $XDG_CACHE_HOME/uv
or $HOME/.cache/uv
on Linux, and {FOLDERID_LocalAppData}\uv\cache
on Windows.
--python-preference
python-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed
: Only use managed Python installations; never use system Python installationsmanaged
: Prefer managed Python installations over system Python installationssystem
: Prefer system Python installations over managed Python installationsonly-system
: Only use system Python installations; never use managed Python installations--python-fetch
python-fetchWhether to automatically download Python when required
Possible values:
automatic
: Automatically fetch managed Python installations when neededmanual
: Do not automatically fetch managed Python installations; require explicit installation--color
color-choiceControl colors in output
[default: auto]
Possible values:
auto
: Enables colored output only when the output is going to a terminal or TTY with supportalways
: Enables colored output regardless of the detected environmentnever
: Disables colored output--config-file
config-fileThe path to a uv.toml
file to use for configuration.
While uv configuration can be included in a pyproject.toml
file, it is not allowed in this context.