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:
Version Request Formats
The following request formats are supported:- Version Numbers
- Version Specifiers
- Implementations
- Paths
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.,[email protected]<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:
- The current working directory
- Each parent directory
- The user-level configuration directory (if none found)
Creating Version Files
Create a project-local.python-version:
.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-versionor.python-versions
Installing Python Executables
uv installs Python executables into yourPATH by default.
Executable Installation
On Unix,uv python install 3.12 installs to ~/.local/bin, creating:
python3.12- Version-specific executable
--default flag:
python- Default Pythonpython3- Python 3.x default
Version Precedence
uv prefers the latest patch version of each minor version:Upgrading Python Versions
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 withpyproject.toml, uv respects the requires-python field:
pyproject.toml
.python-versionfile--pythonflag
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:- Managed Python - In
UV_PYTHON_INSTALL_DIR - PATH executables -
python,python3,python3.x(Unix) orpython.exe(Windows) - 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. Explicitly request debug builds:Disabling Automatic Downloads
By default, uv automatically downloads Python when needed. Control this with thepython-downloads setting:
pyproject.toml
Python Version Preferences
Thepython-preference setting controls which Python installations to prefer:
- managed (default)
- only-managed
- system
- only-system
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 cpPyPy
pypy or ppGraalPy
graalpy or gpPyodide
pyodideManaged Python Distributions
CPython Distributions
uv uses pre-built distributions from Astral’spython-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
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
Windows Registry Registration
On Windows, managed Python versions are registered in the Windows registry per PEP 514. Use with thepy launcher:
Related Documentation
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