Stop Using Pip: Why I Switched to “uv” for Python Projects (10x Faster)
Source: Dev.to
Why the Hype?
- Ridiculously fast – written in Rust,
uvresolves dependencies and installs packages in milliseconds wherepipcan take seconds or minutes. - Cold install: ~10–100× faster than
pip. - Warm install: essentially instant.
- Disk usage: uses a global cache, so you don’t store the same package (e.g., NumPy) multiple times on disk.
Step 1: Installing uv
Windows (PowerShell)
irm https://astral.sh/uv/install.ps1 | iex
macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
Step 2: The “Magic” of uv run
source venv/bin/activate is no longer needed. With uv, you simply create a script and run it; uv automatically creates a temporary environment, installs any missing imports, runs the script, and cleans up.
Create a file hello.py:
import requests
print(requests.get("https://api.github.com").status_code)
Run it:
uv run hello.py
uv detects that requests is required, installs it in a cached environment, and executes the script instantly.
Step 3: Migrating a Project (requirements.txt)
Old way
pip install -r requirements.txt
New way
uv pip install -r requirements.txt
uv respects your existing virtual environment but performs the installation significantly faster.
Step 4: Initializing a New Project
uv init my-new-project
cd my-new-project
uv add pandas fastapi
This creates a pyproject.toml file automatically, eliminating the need for complex setup.
In 2025, speed matters. uv removes the friction of managing Python environments, letting you focus on coding—not waiting.