Leroy
Programming

Installing Python with uv: The Fastest Way to Manage Python

Leroy - Jun 1, 2026 - 3 min read

The Problem with Python Setup

If you've ever set up a Python project, you know the ritual:

  1. Check if Python is installed
  2. Create a virtual environment with python -m venv venv
  3. Activate it (different command on Windows vs macOS vs Linux)
  4. Install packages with pip install -r requirements.txt
  5. Wait. And wait. Pip resolves dependencies one by one.

It works, but it's slow. Painfully slow on large projects.

Enter uv - a Python package and project manager written in Rust, from the team at Astral (the same folks behind Ruff). It's designed to be a drop-in replacement for pip, pip-tools, pipenv, poetry, and pyenv - all in one binary.

What is uv?

uv is a single binary, written in Rust, that:

  • Installs Python versions (uv python install 3.12)
  • Creates virtual environments (uv venv)
  • Installs packages from PyPI (uv pip install)
  • Resolves dependencies 10-100x faster than pip
  • Manages projects with pyproject.toml (uv init, uv add, uv sync)

Install it:

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

Or via your package manager:

# macOS
brew install uv

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

After installation, restart your shell or add ~/.cargo/bin to your PATH.

Install a Specific Python Version

This is what made me fall in love with uv. No more hunting for system package managers or compiling Python from source:

# Install Python 3.12
uv python install 3.12

# List available versions
uv python list

# Use it
uv python pin 3.12

It downloads pre-built binaries from the Astral cache - takes seconds, not minutes. Multiple Python versions coexist without fighting system packages.

Creating a Virtual Environment

uv venv

This creates a .venv directory using the Python version pinned in .python-version or the latest available. It's equivalent to python -m venv .venv but faster.

Activate it the usual way:

source .venv/bin/activate  # macOS/Linux
.venv\Scripts\activate     # Windows

Or use uv run to skip activation entirely - it automatically uses the project's virtual environment:

uv run python myscript.py

Installing Packages

The pip-compatible interface:

# Install a single package
uv pip install flask

# Install from requirements.txt (10-100x faster than pip)
uv pip install -r requirements.txt

# Install from pyproject.toml
uv sync

The first time you run uv pip install, it downloads and caches packages. Subsequent runs are nearly instant because the resolution is cached globally.

Working with Projects

uv also has a project management mode that feels like Rust's cargo or Node.js's npm:

# Create a new project
uv init my-project
cd my-project

# Add dependencies
uv add flask
uv add --dev pytest

# Install everything
uv sync

# Run a command in the project's venv
uv run python app.py

This creates a pyproject.toml and uv.lock file - deterministic, reproducible builds. The lock file pins exact versions for every transitive dependency.

Why I Use uv

Speed

This is the headline feature. Pip resolves dependencies sequentially, downloading metadata for each package one at a time. uv downloads metadata in parallel and caches aggressively. On a project with 50+ dependencies, pip takes 30-60 seconds; uv takes 1-3 seconds.

Single Binary

I don't need pyenv, pipenv, poetry, and virtualenv installed separately. One binary does everything. It's also tiny - around 10MB.

Python Version Management

I no longer rely on my system package manager's Python version. uv downloads any Python version I need in seconds. This is especially useful when working across multiple projects that require different Python versions.

Deterministic Builds

The uv.lock file, like package-lock.json in npm or Cargo.lock in Rust, ensures everyone on the team gets exactly the same dependency tree. No more "it works on my machine."

Drop-in Compatible

If you already have a project using requirements.txt and pip, uv works without any changes. Just run uv pip install instead of pip install. Everything else stays the same.

The Only Downsides

  • New ecosystem - uv is relatively new (first stable release in 2024). Some edge cases in dependency resolution are still being ironed out
  • No ARM Windows builds yet - if you're on ARM Windows (Windows on ARM), you'll need the x86 emulation layer
  • PyPI-only - uv only works with PyPI-compatible registries. Private repositories using other formats may not work

Summary

uv is my default Python tool now. It replaces pyenv, pip, pipenv, and poetry with a single fast binary. The speed difference is dramatic enough that it changes how I work - I no longer hesitate to create a new virtual environment or install a package because it takes under a second.

If you write Python, try uv. You'll wonder why it took this long for someone to build it.

Related Posts