Skip to main content

Overview

uv can detect and use existing Python installations, but it can also install and manage Python versions for you. Python is automatically downloaded when needed — you don’t need to install it first.
Python doesn’t publish official distributable binaries. uv uses distributions from Astral’s python-build-standalone project. See Python distributions for details.

Getting started

1

Install the latest Python

This installs the latest stable Python version.
2

Use the installed Python

uv automatically uses installed versions:
By default, uv only installs versioned executables (e.g., python3.13).
3

Install default executables (experimental)

To also install python and python3 executables:
See installing Python executables for more details.

Installing specific versions

Install any Python version you need:
See python install documentation for all options.

Viewing Python installations

List available and installed Python versions:
This shows:
  • Installed versions (uv-managed and system)
  • Available versions for download
  • Version details (implementation, architecture)
See python list for more details.

Automatic Python downloads

Python is downloaded automatically when needed:
Even without a specific version request:
Automatic downloads can be easily disabled if you want more control.

Using existing Python versions

uv automatically discovers and uses system Python installations. No configuration needed!

Force system Python

Prevent uv from using managed Python versions:
See Python version preference for more details.

Pinning Python versions

In projects

The .python-version file pins the Python version for a project:
uv uses this file when creating virtual environments for the project.

With pyenv compatibility

uv respects .python-version files created by pyenv:

Upgrading Python versions

Upgrading Python patch versions is in preview and may change.
Upgrade to the latest supported patch release:
This updates minor versions to their latest patch (e.g., 3.12.0 → 3.12.7). See python upgrade documentation.

Reinstalling Python

Reinstall uv-managed Python versions:
This reinstalls all previously installed Python versions. Useful for:
  • Fixing corrupted installations
  • Getting improvements to Python distributions
  • Resolving platform-specific issues
Improvements are constantly added to Python distributions, so reinstalling may resolve bugs even if the version number doesn’t change.

Switching Python versions

In projects

1

Check current version

2

Change version

3

Recreate environment

For specific commands

Use --python to override the Python version:

Working with multiple Python versions

Install all versions you need

Test across versions

Build with specific versions

Complete workflow examples

Setting up a new project

1

Install Python

2

Create project

3

Verify Python version

4

Start developing

Migrating to a newer Python version

1

Install new Python

2

Update project

3

Update pyproject.toml

4

Recreate environment

5

Test everything

Working with PyPy

1

Install PyPy

2

Create PyPy environment

3

Use PyPy

Best practices

Always create a .python-version file in your project:
This ensures all team members use the same Python version.
Set minimum Python version in your project metadata:
This documents compatibility and prevents installation on older Python.
Regularly upgrade to latest patch releases:
Patch releases include security fixes and bug improvements.
Install and test with multiple Python versions:
Use CI/CD to automate testing across versions.

Troubleshooting

Install the specific version:
Or list available versions:
Check version resolution:
Override with --python:
Check if automatic downloads are disabled:
Or explicitly install:
Recreate the virtual environment:
Virtual environments are tied to specific Python installations.

Next steps

Python versions concept

Deep dive into Python version management

Command reference

View all uv python commands

Running scripts

Execute Python scripts with uv

Working with projects

Create and manage projects