UV Package Manager
Comprehensive guide to using uv, an extremely fast Python package installer and resolver written in Rust, for modern Python project management and dependency workflows.
When to Use This Skill
- Setting up new Python projects quickly
- Managing Python dependencies faster than pip
- Creating and managing virtual environments
- Installing Python interpreters
- Resolving dependency conflicts efficiently
- Migrating from pip/pip-tools/poetry
- Speeding up CI/CD pipelines
- Managing monorepo Python projects
- Working with lockfiles for reproducible builds
- Optimizing Docker builds with Python dependencies
Core Concepts
1. What is uv?
- Ultra-fast package installer: 10-100x faster than pip
- Written in Rust: Leverages Rust's performance
- Drop-in pip replacement: Compatible with pip workflows
- Virtual environment manager: Create and manage venvs
- Python installer: Download and manage Python versions
- Resolver: Advanced dependency resolution
- Lockfile support: Reproducible installations
2. Key Features
- Blazing fast installation speeds
- Disk space efficient with global cache
- Compatible with pip, pip-tools, poetry
- Comprehensive dependency resolution
- Cross-platform support (Linux, macOS, Windows)
- No Python required for installation
- Built-in virtual environment support
3. UV vs Traditional Tools
- vs pip: 10-100x faster, better resolver
- vs pip-tools: Faster, simpler, better UX
- vs poetry: Faster, less opinionated, lighter
- vs conda: Faster, Python-focused
Installation
Quick Install
On Windows, use WinGet:
Use the official installation guide for other supported installation methods.
Verify Installation
Quick Start
Create a New Project
Install Dependencies
Virtual Environment Management
Pattern 1: Creating Virtual Environments
Pattern 2: Activating Virtual Environments
Pattern 3: Using uv run
Package Management
Pattern 4: Adding Dependencies
Pattern 5: Removing Dependencies
Pattern 6: Upgrading Dependencies
Pattern 7: Locking Dependencies
Python Version Management
Pattern 8: Installing Python Versions
Pattern 9: Setting Python Version
Project Configuration
Pattern 10: pyproject.toml with uv
Pattern 11: Using uv with Existing Projects
For advanced workflows including Docker integration, lockfile management, performance optimization, tool comparison, common workflows, tool integration, troubleshooting, best practices, migration guides, and command reference, see references/advanced-patterns.md [blocked]
