Enhanced uv Cheat Sheet

A comprehensive guide to using `uv`, the fast Python package installer and resolver.

Installation

curl -LsSf https://astral.sh/uv/install.sh | sh

Installs the latest version of uv.

Python Installation & Management

uv uses standalone Python builds, managed independently from system Python.

Virtual Environments

If a virtual environment (like .venv) exists and is activated, uv commands will typically use it automatically.

Dependency & Project Management

uv distinguishes between simply installing packages (like pip install) and managing dependencies listed in pyproject.toml.

Running Commands

uv run ensures the command executes with the correct Python interpreter and dependencies available on PATH.

Disposable Environments / Running Tools

This is ideal for running linters, formatters, etc., without polluting your project's dependencies.

Cache Management

Key Differences & Notes