mcpField
U
uv-python-versions

uv-python-versions

github.com/laurigatesDevelopment59302 installsUpdated 1d ago
Repository

About uv-python-versions

A quick reference skill for managing Python interpreters with UV. It helps Python developers install, find, pin, and switch among CPython and PyPy versions for projects and testing.

Key features

  1. 01Install CPython and PyPy versions
  2. 02List and find interpreters
  3. 03Pin project Python versions
  4. 04Run commands with a selected version
  5. 05Create environments for version testing

Use cases

  1. 01Pinning a project's Python version
  2. 02Testing a project across Python versions
  3. 03Setting up an environment with PyPy
  4. 04Finding installed interpreters

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/laurigates/claude-plugins --skill uv-python-versions

After installing, type/uv-python-versionsin Claude Code to confirm it loaded.

Bundled filesREFERENCE.md

Details

From the project README

UV Python Version Management

Quick reference for installing and managing Python interpreter versions with UV.

When to Use This Skill

Use this skill when...Use a focused sibling instead when...
Installing a specific CPython or PyPy interpreter with uv python installAdding a Python library to a project — use uv-project-management
Pinning a project to a Python version via .python-version or requires-pythonInstalling a global Python CLI tool — use uv-tool-management
Switching between multiple installed interpreters for testingRunning a script with auto-managed Python — use uv-run

When This Skill Applies

  • Installing specific Python versions
  • Switching between multiple Python versions
  • Pinning Python versions for projects
  • Managing CPython and PyPy interpreters
  • Finding and listing installed Python versions

Quick Reference

Installing Python Versions
# Install latest Python
uv python install

# Install specific version
uv python install 3.11
uv python install 3.12
uv python install 3.10 3.11 3.12

# Install exact version
uv python install 3.11.5
uv python install [email protected]

# Install PyPy
uv python install [email protected]
uv python install [email protected]
Listing Python Versions
# List all available versions
uv python list

# List only installed versions
uv python list --only-installed

# List with verbose details
uv python list --verbose
Pinning Python Versions
# Pin version for current project
uv python pin 3.11
uv python pin 3.12.1

# Pin PyPy
uv python pin [email protected]

# Pin with version file
# Creates/updates .python-version
Finding Python Interpreters
# Find any Python installation
uv python find

# Find specific version
uv python find 3.11
uv python find 3.12

# Find PyPy
uv python find pypy
uv python find [email protected]
Using Specific Python Versions
# In project commands
uv run --python 3.11 script.py
uv run --python 3.12 pytest

# Creating virtual environments
uv venv --python 3.11
uv venv --python 3.10 .venv-py310

# Initializing projects
uv init --python 3.12 my-project

Python Version Sources

UV searches for Python in this order:

  1. UV-managed - Installed via uv python install
  2. .python-version - Pin file in project directory
  3. pyproject.toml - requires-python field
  4. System Python - Existing system installations
  5. Environment - $PATH and standard locations

Version Pinning

.python-version File
# Pin creates this file
uv python pin 3.11

# File contents
3.11

# Exact version
uv python pin 3.11.5
pyproject.toml
[project]
requires-python = ">=3.11"

# UV respects this constraint

Supported Python Implementations

CPython
# Default implementation
uv python install 3.11
uv python install [email protected]
uv python install [email protected]
PyPy
# Alternative Python implementation
uv python install [email protected]
uv python install [email protected]

Common Commands

# Install and pin latest Python 3.12
uv python install 3.12 && uv python pin 3.12

# Install multiple versions for testing
uv python install 3.10 3.11 3.12

# Check which Python is active
uv python find
uv run python --version

# Uninstall version (manual)
rm -rf ~/.local/share/uv/python/cpython-3.11.5-*

Integration with Projects

Project Initialization
# Initialize with specific Python
uv init --python 3.11 my-project

# Generates .python-version
cat .python-version
# 3.11
Running Commands
# Use project's pinned Python
uv run python script.py

# Override with specific version
uv run --python 3.12 script.py

# Use system Python
uv run --python python3 script.py

Multi-Version Testing

# Test across Python versions
uv run --python 3.10 pytest
uv run --python 3.11 pytest
uv run --python 3.12 pytest

# Create version-specific venvs
uv venv --python 3.10 .venv-py310
uv venv --python 3.11 .venv-py311
uv venv --python 3.12 .venv-py312

Key Features

  • Fast downloads: Parallel downloads with caching
  • Automatic: Downloads versions on-demand
  • Isolated: UV-managed versions don't conflict with system Python
  • Portable: Uses standalone Python distributions
  • Cross-platform: Works on Linux, macOS, and Windows

See Also

  • uv-project-management - Using pinned Python versions in projects
  • uv-workspaces - Python versions in monorepos
  • python-testing - Testing across multiple Python versions

References

Comments

Markdown supported