Skip to main content
A Python version is composed of a Python interpreter (the python executable), the standard library, and other supporting files.

Managed vs System Python

uv supports two types of Python installations:

Managed Python

Python versions installed by uv itself

System Python

Python versions from the OS or other tools (pyenv, Homebrew, etc.)
uv treats all non-uv Python installations as “system” Python, including those managed by pyenv, Homebrew, or conda.

Requesting a Version

Specify a Python version with the --python flag in most uv commands:
uv will ensure Python 3.11.6 is available — downloading and installing it if necessary — then create the virtual environment with it.

Version Request Formats

The following request formats are supported:

Complete Format Reference

  • <version> - e.g., 3, 3.12, 3.12.3
  • <version-specifier> - e.g., >=3.12,<3.13
  • <version><short-variant> - e.g., 3.13t, 3.12.0d
  • <version>+<variant> - e.g., 3.13+freethreaded, 3.12.0+debug
  • <implementation> - e.g., cpython, pypy
  • <implementation>@<version> - e.g., cpython@3.12
  • <implementation><version> - e.g., cpython3.12, cp312
  • <implementation>-<version>-<os>-<arch>-<libc> - e.g., cpython-3.12.3-macos-aarch64-none
  • <executable-path> - e.g., /opt/homebrew/bin/python3
  • <executable-name> - e.g., mypython3
  • <install-dir> - e.g., /some/environment/

Python Version Files

The .python-version file sets a default Python version request.

How It Works

uv searches for .python-version in:
  1. The current working directory
  2. Each parent directory
  3. The user-level configuration directory (if none found)

Creating Version Files

Create a project-local .python-version:
Create a global .python-version:

Version File Format

Any version request format can be used, though version numbers are recommended for tool interoperability:
.python-version
Discovery of .python-version files can be disabled with --no-config.

Installing Python Versions

uv bundles downloadable CPython and PyPy distributions for macOS, Linux, and Windows.
By default, Python versions are automatically downloaded as needed. You don’t need to use uv python install explicitly.

Installation Examples

Default Install Behavior

Without arguments, uv python install will:
  • Verify a managed Python is installed, OR
  • Install the latest Python version, OR
  • Install versions from .python-version or .python-versions
Available Python versions are frozen per uv release. To install new Python versions, upgrade uv.

Installing Python Executables

uv installs Python executables into your PATH by default.

Executable Installation

On Unix, uv python install 3.12 installs to ~/.local/bin, creating:
  • python3.12 - Version-specific executable
With the --default flag:
Also installs:
  • python - Default Python
  • python3 - Python 3.x default
If ~/.local/bin is not in your PATH, add it with:

Version Precedence

uv prefers the latest patch version of each minor version:

Upgrading Python Versions

Upgrades are only supported for uv-managed Python versions. PyPy, GraalPy, and Pyodide upgrades are not currently supported.
uv allows transparent upgrades to the latest patch release (e.g., 3.13.4 → 3.13.5). Minor version upgrades (e.g., 3.12 → 3.13) are not automatic as they can affect dependency resolution.

Upgrade Commands

Virtual Environment Auto-Upgrade

After upgrading, virtual environments using the Python version are automatically upgraded to the new patch version.
If a virtual environment was created with an explicit patch version (uv venv -p 3.10.8), it won’t be automatically upgraded.

Minor Version Directories

Automatic upgrades use symbolic links (Unix) or junctions (Windows):

Project Python Versions

For projects with pyproject.toml, uv respects the requires-python field:
pyproject.toml
The first compatible Python version will be used, unless overridden by:
  • .python-version file
  • --python flag

Viewing Available Versions

List Installed and Available

Finding Python Executables

Find the path to a Python executable:

Discovery of Python Versions

When searching for a Python version, uv checks:
  1. Managed Python - In UV_PYTHON_INSTALL_DIR
  2. PATH executables - python, python3, python3.x (Unix) or python.exe (Windows)
  3. Windows registry - Microsoft Store and registered interpreters

Discovery Behavior

  • Managed Python - Prefers newer versions first
  • System Python - Uses first compatible version found
  • Virtual environments - Checked before system Python in some contexts

Python Pre-releases

Pre-release Python versions (alpha, beta, RC) are not selected by default:
  • Used only if no stable release matches the request
  • Used if explicitly requested via path
  • Used if only pre-release available for request

Free-threaded Python

uv supports free-threaded Python in CPython 3.13+.

Python 3.13 Behavior

Free-threaded builds must be explicitly requested:

Python 3.14+ Behavior

Free-threaded interpreters can be used without explicit selection, but GIL-enabled builds are preferred. To require GIL-enabled Python:

Debug Python Variants

uv supports debug builds of Python with debug assertions enabled.
Debug builds are significantly slower and not appropriate for general use.
Explicitly request debug builds:

Disabling Automatic Downloads

By default, uv automatically downloads Python when needed. Control this with the python-downloads setting:
pyproject.toml
Or use the command-line flag:

Python Version Preferences

The python-preference setting controls which Python installations to prefer:
Prefer managed Python over system Python, but prefer existing system Python over downloading.

Python Implementation Support

uv supports CPython, PyPy, Pyodide, and GraalPy implementations.

Implementation Names

CPython

cpython or cp

PyPy

pypy or pp

GraalPy

graalpy or gp

Pyodide

pyodide

Managed Python Distributions

CPython Distributions

uv uses pre-built distributions from Astral’s python-build-standalone project, which:
  • Are self-contained and highly portable
  • Include performance optimizations (PGO, LTO)
  • Are used by Mise, rules_python, and other tools
These distributions have some behavior quirks due to portability. See the python-build-standalone quirks documentation.

PyPy Distributions

PyPy is no longer actively developed and only supports Python versions up to 3.11.
Provided by the PyPy project.

Pyodide Distributions

Provided by the Pyodide project. Pyodide is CPython ported to WebAssembly/Emscripten.

Platform Support

x86_64 Emulation on aarch64

Both macOS (Rosetta 2) and Windows (WoA emulation) support running x86_64 binaries on aarch64 through transparent emulation. You can:
  • Use x86_64 uv on aarch64
  • Use x86_64 Python on aarch64
  • Mix architectures for uv and Python
A Python interpreter needs packages matching its architecture — all x86_64 or all aarch64.

Windows Registry Registration

On Windows, managed Python versions are registered in the Windows registry per PEP 514. Use with the py launcher:
On uninstall, uv removes the registry entry and any broken entries.

Projects

Learn about project structure and the requires-python field

Dependencies

Understand how Python versions affect dependency resolution

Cache

Learn where Python installations are cached