uv

Part of the Python Packaging Ecosystem. Created by Astral (same team behind Ruff). Written in Rust. The dominant Python project manager as of 2026.

For how uv fits into the broader landscape (vs Poetry, Hatch, PDM, Pants, Maturin), see Python Packaging Ecosystem.

Hybrid Virtual Environments

uv introduces hybrid virtual environments that combine the benefits of isolated environments (venv, pipenv, poetry) with a global package cache similar to pnpm. Instead of duplicating packages for every project, uv stores packages globally and uses symlinks to link them into the local virtual environment.

This approach offers significant advantages in terms of speed and storage efficiency. When a project requires a specific package version, uv either uses the globally cached version or installs a new version specifically for that project, ensuring environment isolation.

In contrast, tools like pip with venv or poetry always create fully isolated environments, which can lead to unnecessary duplication of packages and slower environment setup times.

Single File Deployment

uv provides a feature for creating single file deployments, allowing you to bundle your entire Python environment and application into a single executable file. This can be achieved using the uv pack command:

uv pack -o app_executable your_script.py
./app_executable

This is particularly useful for deployment scenarios where you need a fully portable environment or when sharing scripts that need to run without prior dependency installation. While tools like pyinstaller or pex offer similar functionality, uv aims for a more integrated and seamless experience within its dependency management workflow.

Python Version Management

uv offers integrated Python version management, allowing you to specify the required Python version in pyproject.toml or directly in your script using embedded directives. This feature is similar to pyenv, but with a more automated and integrated approach:

[tool.uv]
requires-python = ">=3.10"
uv python install 3.11
uv python use 3.11

Instead of manually managing Python installations and manually creating virtual environments with the appropriate interpreter, uv handles the entire installation and configuration process. Unlike venv, where you need to have the correct Python version installed beforehand, uv can download and set up the necessary version automatically.

CLI Tool Management

uv can also manage CLI tools globally, similar to how pipx allows you to globally install Python applications in isolated environments. This is particularly useful for development tools like black, flake8, or poetry, as well as for custom scripts that need to run globally but in an isolated manner.

uv tool install black
uv tool list
uv tool remove black

Unlike pipx, which is primarily focused on globally distributed CLI tools, uv offers a more unified approach, combining this capability with its project-based dependency management.

Embedded Script Directives

One of the standout features of uv is its support for embedded directives directly within Python scripts. This feature allows you to declare dependencies and environment requirements at the top of your script using a simple TOML syntax. You can also specify specific versions of libraries to ensure consistent behavior:

# /// script
# requires-python = ">=3.8"
# dependencies = [
#     "requests==2.31.0",
#     "rich>=13.5.0",
# ]
# ///
 
import requests
from rich.console import Console
 
console = Console()
response = requests.get("https://api.example.com")
console.print(response.json())

By running this script with uv run, uv will automatically create an environment, install dependencies, and execute the script, offering a self-contained and portable solution for simple automation tasks or for sharing scripts without the need for a full pyproject.toml setup.