Python uv Complete Guide 2026 — Practical Use of a 10x Faster Package Manager Than pip

Have you ever been frustrated by pip install being painfully slow during Python development? Especially in projects with many dependencies, setting up a virtual environment can take minutes — highly inefficient. uv is the answer. Built in Rust, this Python package manager is up to 100 times faster than pip, typically 10–20 times faster, and handles virtual environments and Python version management all in one. By 2026, many Python developers have already switched to uv. Let me show you step-by-step how to set it up in real projects.

uv - pip killer or yet another package manager?

📸 uv - pip killer or yet another package manager?

⚡ What is uv? — The High-Speed Package Manager Replacing pip

uv is a Python package manager developed by the Astral team (creators of Ruff). It started gaining rapid traction at the end of 2024 and by 2026 has become a standard tool in Python development.

Python Package Managers: pip vs uv | Sana Faisal posted on ...

📸 Python Package Managers: pip vs uv | Sana Faisal posted on ...

uv vs pip Speed Comparison

  • Installing numpy: pip 8s → uv 0.4s (20x faster)
  • Full Django + dependencies: pip 45s → uv 3s (15x faster)
  • ML package bundle (torch, transformers, etc.): pip 3min → uv 12s (15x faster)

Once packages are downloaded, they're loaded instantly from cache — making subsequent installs even faster.

Introducing uv: Next-Gen Python Package Manager | by Vishnu ...

📸 Introducing uv: Next-Gen Python Package Manager | by Vishnu ...

🚀 Installation and Basic Usage

044 - Python Environments, Again | uv: A Guide to Python ...

📸 044 - Python Environments, Again | uv: A Guide to Python ...

1. Installing uv

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

# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

# Install via pip
pip install uv

2. Python Version Management

uv can install and switch Python versions directly — eliminating the need for pyenv.

# Install Python 3.13
uv python install 3.13

# List available Python versions
uv python list

# Pin to a specific version
uv python pin 3.12

3. Creating Virtual Environments

# Create virtual environment (default .venv folder)
uv venv

# Create with specific Python version
uv venv --python 3.13

# Activate (macOS/Linux)
source .venv/bin/activate

# Activate (Windows)
.venv\Scripts\activate

📦 Package Installation — Comparison with pip Commands

# pip → uv
pip install requests        →  uv pip install requests
pip install -r requirements.txt  →  uv pip install -r requirements.txt
pip freeze > requirements.txt   →  uv pip freeze > requirements.txt
pip list                    →  uv pip list

Just add uv before your existing pip commands. The learning curve is practically zero.

🎯 Project Management with uv — Integrated pyproject.toml

uv's real strength shines in project management. Start with uv init to manage dependencies based on pyproject.toml.

# Initialize new project
uv init my-project
cd my-project

# Add packages (auto-updates pyproject.toml)
uv add fastapi
uv add pytest --dev  # development dependency

# Remove package
uv remove requests

# Sync dependencies (based on lock file)
uv sync

# Run scripts
uv run python main.py
uv run pytest

Generated Project Structure

my-project/
├── pyproject.toml    # Project metadata + dependencies
├── uv.lock           # Precise version locking (ensures consistent environment across team)
├── .python-version   # Specifies Python version
└── src/
    └── my_project/

💡 Practical Tips — Using uv in CI/CD and Team Collaboration

Using uv in GitHub Actions

name: Test
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install uv
        uses: astral-sh/setup-uv@v3
        with:
          version: "latest"
      - name: Install dependencies
        run: uv sync
      - name: Run tests
        run: uv run pytest

Using the setup-uv action automatically installs uv and enables caching, significantly speeding up CI pipelines.

Using uv in Docker

FROM python:3.13-slim
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-cache

COPY . .
CMD ["uv", "run", "python", "main.py"]

🔄 Migrating Existing pip Projects to uv

How to transition from a requirements.txt-based project to uv:

# 1. Initialize uv (in existing folder)
uv init --bare

# 2. Import dependencies from requirements.txt
uv add $(cat requirements.txt | grep -v '#' | tr '\n' ' ')

# Or install directly via uv pip
uv pip install -r requirements.txt

# 3. Generate lock file
uv lock

⚠️ Important Notes

  • Some C extension packages may be slow initially due to missing binary cache — performance improves after first build
  • Do not mix with conda environments — high risk of conflicts
  • Always commit uv.lock to git to ensure consistent environments across all team members

🎯 Final Thoughts

uv is a true game-changer in Python development. If you’ve been frustrated by slow pip installs, messy virtual environments, or long CI/CD setup times, uv is for you. Once you try it, you won’t want to go back to pip 😄

Start with uv venv + uv pip install, then gradually adopt uv init + uv add as you get comfortable!


📎 Resources

댓글