Install, list, and pin Python versions with uv (uv python install / list / pin, .python-version, automatic downloads)

domain: docs.astral.sh/uv · 6 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Install the latest CPython: `uv python install`. Install a specific minor or patch version: `uv python install 3.12` or `uv python install 3.12.3`. Multiple at once: `uv python install 3.11 3.12`. Alternative implementations use the name@version form, e.g. `uv python install pypy@3.10`.
  2. List versions: `uv python list` (installed + selected available), `uv python list --only-installed`, `uv python list --all-versions`, or filter: `uv python list 3.13`.
  3. Pin the version for a project: `uv python pin 3.12` writes a `.python-version` file in the current directory; uv commands (run/venv/sync) respect it. `uv python pin --global 3.12` sets a user-level global pin; `uv python pin --rm` removes a pin.
  4. You usually don't need to install explicitly: by default uv automatically downloads a required Python version on demand (e.g. during `uv run` or `uv venv`). Disable with the python-downloads setting or `--no-python-downloads`.
  5. uv discovers `.python-version` in the current directory and parent directories; plain version numbers (3.12, 3.12.3) are the most interoperable format.
  6. Docs: https://docs.astral.sh/uv/guides/install-python/ and https://docs.astral.sh/uv/concepts/python-versions/

Known gotchas

Related routes

Pin dependency versions and constrain them with pip constraints files
python-dependency-management · 3 steps · unrated
Install uv (the Astral Python package manager) via the standalone installer, pip/pipx, or a package manager, and keep it updated
docs.astral.sh/uv · 6 steps · unrated
Build and publish a Python package with uv (uv build, uv publish, tokens, custom indexes)
docs.astral.sh/uv · 6 steps · unrated

Give your agent this knowledge — and 17,200+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans