uv defines and respects the following environment variables:
Equivalent to the --break-system-packages command-line argument. If set to true,
uv will allow the installation of packages that conflict with system-installed packages.
WARNING: UV_BREAK_SYSTEM_PACKAGES=true is intended for use in continuous integration
(CI) or containerized environments and should be used with caution, as modifying the system
Python can lead to unexpected behavior.
Equivalent to the --build-constraint command-line argument. If set, uv will use this file
as constraints for any source distribution builds. Uses space-separated list of files.
Equivalent to the --cache-dir command-line argument. If set, uv will use this
directory for caching instead of the default cache directory.
Equivalent to the --compile-bytecode command-line argument. If set, uv
will compile Python source files to bytecode after installation.
Timeout (in seconds) for bytecode compilation.
Sets the maximum number of source distributions that uv will build concurrently at any given time.
Sets the maximum number of in-flight concurrent downloads that uv will perform at any given time.
Controls the number of threads used when installing and unzipping packages.
Equivalent to the --config-file command-line argument. Expects a path to a
local uv.toml file to use as the configuration file.
Equivalent to the --constraint command-line argument. If set, uv will use this
file as the constraints file. Uses space-separated list of files.
The directory for storage of credentials when using a plain text backend.
Equivalent to the --custom-compile-command command-line argument.
Used to override uv in the output header of the requirements.txt files generated by
uv pip compile. Intended for use-cases in which uv pip compile is called from within a wrapper
script, to include the name of the wrapper script in the output file.
Equivalent to the --default-index command-line argument. If set, uv will use
this URL as the default index when searching for packages.
Equivalent to the --dev command-line argument. If set, uv will include
development dependencies.
The URL from which to download uv using the standalone installer. By default, installs from
uv's GitHub Releases. INSTALLER_DOWNLOAD_URL is also supported as an alias, for backwards
compatibility.
.env files from which to load environment variables when executing uv run commands.
Equivalent to the --exclude-newer command-line argument. If set, uv will
exclude distributions published after the specified date.
Equivalent to the --extra-index-url command-line argument. If set, uv will
use this space-separated list of URLs as additional indexes when searching for packages.
(Deprecated: use UV_INDEX instead.)
Equivalent to the --find-links command-line argument. If set, uv will use this
comma-separated list of additional locations to search for packages.
Equivalent to the --fork-strategy argument. Controls version selection during universal
resolution.
Equivalent to the --frozen command-line argument. If set, uv will run without
updating the uv.lock file.
Equivalent to the --token argument for self update. A GitHub token for authentication.
Enables fetching files stored in Git LFS when installing a package from a Git repository.
The number of retries for HTTP requests. (default: 3)
Timeout (in seconds) for HTTP requests. (default: 30 s)
Equivalent to the --index command-line argument. If set, uv will use this
space-separated list of URLs as additional indexes when searching for packages.
Equivalent to the --index-strategy command-line argument.
For example, if set to unsafe-best-match, uv will consider versions of a given package
available across all index URLs, rather than limiting its search to the first index URL
that contains the package.
Equivalent to the --index-url command-line argument. If set, uv will use this
URL as the default index when searching for packages.
(Deprecated: use UV_DEFAULT_INDEX instead.)
Provides the HTTP Basic authentication password for a named index.
The name parameter is the name of the index. For example, given an index named foo,
the environment variable key would be UV_INDEX_FOO_PASSWORD.
Provides the HTTP Basic authentication username for a named index.
The name parameter is the name of the index. For example, given an index named foo,
the environment variable key would be UV_INDEX_FOO_USERNAME.
Equivalent to the --build-backend argument for uv init. Determines the default backend
to use when creating a new project.
Equivalent to the --allow-insecure-host argument.
Disable ZIP validation for streamed wheels and ZIP-based source distributions.
WARNING: Disabling ZIP validation can expose your system to security risks by bypassing integrity checks and allowing uv to install potentially malicious ZIP files. If uv rejects a ZIP file due to failing validation, it is likely that the file is malformed; consider filing an issue with the package maintainer.
The URL from which to download uv using the standalone installer and self update feature,
in lieu of the default GitHub Enterprise URL.
The URL from which to download uv using the standalone installer and self update feature,
in lieu of the default GitHub URL.
The directory in which to install uv using the standalone installer and self update feature.
Defaults to ~/.local/bin.
Equivalent to the --isolated command-line argument. If set, uv will avoid discovering
a pyproject.toml or uv.toml file.
Equivalent to the --keyring-provider command-line argument. If set, uv
will use this value as the keyring provider.
Overrides the environment-determined libc on linux systems when filling in the current platform
within Python version requests. Options are: gnu, gnueabi, gnueabihf, musl, and none.
Equivalent to the --link-mode command-line argument. If set, uv will use this as
a link mode.
Equivalent to the --locked command-line argument. If set, uv will assert that the
uv.lock remains unchanged.
Add additional context and structure to log messages.
If logging is not enabled, e.g., with RUST_LOG or -v, this has no effect.
Require use of uv-managed Python versions.
Equivalent to the --native-tls command-line argument. If set to true, uv will
use the system's trust store instead of the bundled webpki-roots crate.
Equivalent to the --no-binary command-line argument. If set, uv will install
all packages from source. The resolver will still use pre-built wheels to
extract package metadata, if available.
Equivalent to the --no-binary-package command line argument. If set, uv will
not use pre-built wheels for the given space-delimited list of packages.
Equivalent to the --no-build command-line argument. If set, uv will not build
source distributions.
Equivalent to the --no-build-isolation command-line argument. If set, uv will
skip isolation when building source distributions.
Equivalent to the --no-build-package command line argument. If set, uv will
not build source distributions for the given space-delimited list of packages.
Equivalent to the --no-cache command-line argument. If set, uv will not use the
cache for any operations.
Equivalent to the --no-config command-line argument. If set, uv will not read
any configuration files from the current directory, parent directories, or user configuration
directories.
Equivalent to the --no-dev command-line argument. If set, uv will exclude
development dependencies.
Equivalent to the --no-editable command-line argument. If set, uv
installs or exports any editable dependencies, including the project and any workspace
members, as non-editable.
Ignore .env files when executing uv run commands.
Disable GitHub-specific requests that allow uv to skip git fetch in some circumstances.
Disable Hugging Face authentication, even if HF_TOKEN is set.
Skip writing uv installer metadata files (e.g., INSTALLER, REQUESTED, and direct_url.json) to site-packages .dist-info directories.
Disable use of uv-managed Python versions.
Avoid modifying the PATH environment variable when installing uv using the standalone
installer and self update feature. INSTALLER_NO_MODIFY_PATH is also supported as an
alias, for backwards compatibility.
Equivalent to the --no-progress command-line argument. Disables all progress output. For
example, spinners and progress bars.
Equivalent to the --no-sync command-line argument. If set, uv will skip updating
the environment.
Equivalent to the --no-verify-hashes argument. Disables hash verification for
requirements.txt files.
Use to disable line wrapping for diagnostics.
Equivalent to the --offline command-line argument. If set, uv will disable network access.
Equivalent to the --override command-line argument. If set, uv will use this file
as the overrides file. Uses space-separated list of files.
Equivalent to the --prerelease command-line argument. For example, if set to
allow, uv will allow pre-release versions for all dependencies.
Equivalent to the --preview argument. Enables preview mode.
Equivalent to the --preview-features argument. Enables specific preview features.
Equivalent to the --project command-line argument.
Specifies the path to the directory to use for a project virtual environment.
See the project documentation for more details.
Don't upload a file if it already exists on the index. The value is the URL of the index.
Equivalent to the --index command-line argument in uv publish. If
set, uv the index with this name in the configuration for publishing.
Equivalent to the --password command-line argument in uv publish. If
set, uv will use this password for publishing.
Equivalent to the --token command-line argument in uv publish. If set, uv
will use this token (with the username __token__) for publishing.
Equivalent to the --publish-url command-line argument. The URL of the upload
endpoint of the index to use with uv publish.
Equivalent to the --username command-line argument in uv publish. If
set, uv will use this username for publishing.
Managed PyPy installations are downloaded from python.org.
This variable can be set to a mirror URL to use a
different source for PyPy installations. The provided URL will replace
https://downloads.python.org/pypy in, e.g.,
https://downloads.python.org/pypy/pypy3.8-v7.3.7-osx64.tar.bz2.
Distributions can be read from a local directory by using the file:// URL scheme.
Equivalent to the --python command-line argument. If set to a path, uv will use
this Python interpreter for all operations.
Specifies the directory to place links to installed, managed Python executables.
Specifies the directory for caching the archives of managed Python installations before installation.
Pin managed CPython versions to a specific build version.
For CPython, this should be the build date (e.g., "20250814").
Equivalent to the
python-downloads setting and, when disabled, the
--no-python-downloads option. Whether uv should allow Python downloads.
Managed Python installations information is hardcoded in the uv binary.
This variable can be set to a URL pointing to JSON to use as a list for Python installations. This will allow for setting each property of the Python installation, mostly the url part for offline mirror.
Note that currently, only local paths are supported.
Pin managed GraalPy versions to a specific build version.
For GraalPy, this should be the GraalPy version (e.g., "24.2.2").
Whether to install the Python executable into the UV_PYTHON_BIN_DIR directory.
Specifies the directory for storing managed Python installations.
Managed Python installations are downloaded from the Astral
python-build-standalone project.
This variable can be set to a mirror URL to use a different source for Python installations.
The provided URL will replace https://github.com/astral-sh/python-build-standalone/releases/download in, e.g.,
https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz.
Distributions can be read from a local directory by using the file:// URL scheme.
Whether to install the Python executable into the Windows registry.
Whether uv should prefer system or managed Python versions.
Pin managed Pyodide versions to a specific build version.
For Pyodide, this should be the Pyodide version (e.g., "0.28.1").
Pin managed PyPy versions to a specific build version.
For PyPy, this should be the PyPy version (e.g., "7.3.20").
Timeout (in seconds) for HTTP requests. Equivalent to UV_HTTP_TIMEOUT.
Equivalent to the --require-hashes command-line argument. If set to true,
uv will require that all dependencies have a hash specified in the requirements file.
Equivalent to the --resolution command-line argument. For example, if set to
lowest-direct, uv will install the lowest compatible versions of all direct dependencies.
Use to set the stack size used by uv.
The value is in bytes, and if both UV_STACK_SIZE are RUST_MIN_STACK unset, uv uses a 4MB
(4194304) stack. UV_STACK_SIZE takes precedence over RUST_MIN_STACK.
Unlike the normal RUST_MIN_STACK semantics, this can affect main thread
stack size, because we actually spawn our own main2 thread to work around
the fact that Windows' real main thread is only 1MB. That thread has size
max(UV_STACK_SIZE, 1MB).
Equivalent to the --system command-line argument. If set to true, uv will
use the first Python interpreter found in the system PATH.
WARNING: UV_SYSTEM_PYTHON=true is intended for use in continuous integration (CI)
or containerized environments and should be used with caution, as modifying the system
Python can lead to unexpected behavior.
Used to disable delay for HTTP retries in tests.
Specifies the "bin" directory for installing tool executables.
Specifies the directory where uv stores managed tools.
Equivalent to the --torch-backend command-line argument (e.g., cpu, cu126, or auto).
Used ephemeral environments like CI to install uv to a specific path while preventing the installer from modifying shell profiles or environment variables.
Equivalent to the --clear command-line argument. If set, uv will remove any
existing files or directories at the target path.
Install seed packages (one or more of: pip, setuptools, and wheel) into the virtual environment
created by uv venv.
Note that setuptools and wheel are not included in Python 3.12+ environments.
uv also reads the following externally defined environment variables:
General proxy for all network requests.
Used with --python-platform aarch64-linux-android and related variants to set the
Android API level. (i.e., the minimum supported Android API level).
Defaults to 24.
Path to user-level configuration directory on Windows systems.
Used to detect Bash shell usage.
Use to control color via anstyle.
Overrides terminal width used for wrapping. This variable is not read by uv directly.
This is a quasi-standard variable, described, e.g., in ncurses(3x).
Used to determine if an active Conda environment is the base environment or not.
Used to detect an activated Conda environment.
Used to detect Fish shell usage.
Forces colored output regardless of terminal support.
See force-color.org.
Indicates that the current process is running in GitHub Actions.
uv publish may attempt trusted publishing flows when set
to true.
Indicates that the current process is running in GitLab CI.
uv publish may attempt trusted publishing flows when set
to true.
Authentication token for Hugging Face requests. When set, uv will use this token
when making requests to https://huggingface.co/ and any subdomains.
The standard HOME env var.
Proxy for HTTPS requests.
Proxy for HTTP requests.
Timeout (in seconds) for HTTP requests. Equivalent to UV_HTTP_TIMEOUT.
Used with --python-platform arm64-apple-ios and related variants to set the
deployment target (i.e., the minimum supported iOS version).
Defaults to 13.0.
Used to detect when running inside a Jupyter notebook.
Used to detect Ksh shell usage.
Used to look for Microsoft Store Pythons installations.
Used with --python-platform macos and related variants to set the
deployment target (i.e., the minimum supported macOS version).
Defaults to 13.0, the least-recent non-EOL macOS version at time of writing.
Use to set the .netrc file location.
Disables colored output (takes precedence over FORCE_COLOR).
See no-color.org.
Comma-separated list of hostnames (e.g., example.com) and/or patterns (e.g., 192.168.1.0/24) that should bypass the proxy.
Used to detect NuShell usage.
The standard PAGER posix env var. Used by uv to configure the appropriate pager.
The standard PATH env var.
Used to detect the use of the Windows Command Prompt (as opposed to PowerShell).
The standard PWD posix env var.
The validation modes to use when run with --compile.
See PycInvalidationMode.
Adds directories to Python module search path (e.g., PYTHONPATH=/path/to/modules).
The pyx API key (e.g., sk-pyx-...).
The URL of the pyx Simple API server.
The pyx authentication token (e.g., eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...), as output by uv auth token.
The domain of the pyx CDN.
Specifies the directory where uv stores pyx credentials.
If set, it can be used to display more stack trace details when a panic occurs. This is used by uv particularly on windows to show more details during a platform exception.
For example:
RUST_BACKTRACE=1will print a short backtrace.RUST_BACKTRACE=fullwill print a full backtrace.
See the Rust backtrace documentation for more.
If set, uv will use this value as the log level for its --verbose output. Accepts
any filter compatible with the tracing_subscriber crate.
For example:
RUST_LOG=uv=debugis the equivalent of adding--verboseto the command lineRUST_LOG=tracewill enable trace-level logging.
See the tracing documentation for more.
Use to set the stack size used by uv.
The value is in bytes, and if both UV_STACK_SIZE are RUST_MIN_STACK unset, uv uses a 4MB
(4194304) stack. UV_STACK_SIZE takes precedence over RUST_MIN_STACK.
Prefer setting UV_STACK_SIZE, since RUST_MIN_STACK also affects subprocesses, such as
build backends that use Rust code.
Unlike the normal RUST_MIN_STACK semantics, this can affect main thread
stack size, because we actually spawn our own main2 thread to work around
the fact that Windows' real main thread is only 1MB. That thread has size
max(RUST_MIN_STACK, 1MB).
The standard SHELL posix env var.
Custom certificate bundle file path for SSL connections.
If set, uv will use this file for mTLS authentication. This should be a single file containing both the certificate and the private key in PEM format.
Path to system-level configuration directory on Windows systems.
Use to create the tracing durations file via the tracing-durations-export feature.
Path to root directory of user's profile on Windows systems.
The path to the binary that was used to invoke uv.
This is propagated to all subprocesses spawned by uv.
If the executable was invoked through a symbolic link, some platforms will return the path of the symbolic link and other platforms will return the path of the symbolic link’s target.
See https://doc.rust-lang.org/std/env/fn.current_exe.html#security for security considerations.
Used to detect an activated virtual environment.
If set to 1 before a virtual environment is activated, then the
virtual environment name will not be prepended to the terminal prompt.
Path to directory where executables are installed.
Path to cache directory on Unix systems.
Path to system-level configuration directory on Unix systems.
Path to user-level configuration directory on Unix systems.
Path to directory for storing managed Python installations and tools.
Used to determine which .zshenv to use when Zsh is being used.
Used to detect Zsh shell usage.