What is uv?

uv is an extremely fast Python package and project manager built by Astral (the team behind Ruff). It replaces pip, venv, pyenv, and more in a single tool.

Install uv

macOS/Linux

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

Windows

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Homebrew

brew install uv

Verify Installation

uv --version

Install Python via uv

You don’t need to install Python separately — uv handles it:

uv python install 3.12

Check available versions:

uv python list

Create a Project

uv init my-project
cd my-project

This creates a project with pyproject.toml and a .python-version file.

Add Dependencies

uv add flask
uv add fastapi uvicorn

Dependencies are tracked in pyproject.toml and locked in uv.lock.

Run Your Code

uv run python main.py
uv run flask run

uv run automatically creates and manages the virtual environment for you — no manual source venv/bin/activate needed.

Why uv?

  • Installs packages 10-100x faster than pip
  • Manages Python versions (replaces pyenv)
  • Handles virtual environments automatically
  • Single pyproject.toml for everything
  • Drop-in replacement: already familiar commands