Master the uv package manager for fast Python dependency

by wshobson · MIT license · ★ 39,857 on GitHub · updated Sep 21

Uv package manager cover

Master the uv package manager for fast Python dependency management, virtual environments, and modern Python project workflows. Use when setting up Python projects, managing dependencies, or optimizing Python development workflows with uv.

---
name: uv-package-manager
description: Master the uv package manager for fast Python dependency management, virtual environments, and modern Python project workflows. Use when setting up Python projects, managing dependencies, or optimizing Python development workflows with uv.
---

# 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

Overview

Comprehensive guide to using uv, an extremely fast Python package installer and resolver written in Rust, for modern Python project management and dependency workflows.

Manual install (npx, ZIP)
Claude Codenpx skills add wshobson/agents --skill uv-package-manager -g -a claude-code
Claude Code (manual)mkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/wshobson/agents/tar.gz/4236bb91f839 \ | tar -xz -C ~/.claude/skills --strip-components=4 agents-4236bb91f839/plugins/python-development/skills/uv-package-manager
Windows (PowerShell)New-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/69c148b7045ca8459cec/uv-package-manager.zip" -OutFile "$env:TEMP\uv-package-manager.zip"; Expand-Archive "$env:TEMP\uv-package-manager.zip" -DestinationPath "$HOME\.claude\skills" -Force
Claude.ai / desktopDownload the ZIP and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md6.9 KB
  • references/1 file · 8.4 KB
Read the files here
wshobson/4236bb92 files
SKILL.md
Show the full text346 lines

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
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

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

# Using pip (if you already have Python)
pip install uv

# Using Homebrew (macOS)
brew install uv

# Using cargo (if you have Rust)
cargo install --git https://github.com/astral-sh/uv uv
Verify Installation
uv --version
# uv 0.x.x

Quick Start

Create a New Project
# Create new project with virtual environment
uv init my-project
cd my-project

# Or create in current directory
uv init .

# Initialize creates:
# - .python-version (Python version)
# - pyproject.toml (project config)
# - README.md
# - .gitignore
Install Dependencies
# Install packages (creates venv if needed)
uv add requests pandas

# Install dev dependencies
uv add --dev pytest black ruff

# Install from requirements.txt
uv pip install -r requirements.txt

# Install from pyproject.toml
uv sync

Virtual Environment Management

Pattern 1: Creating Virtual Environments
# Create virtual environment with uv
uv venv

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

# Create with custom name
uv venv my-env

# Create with system site packages
uv venv --system-site-packages

# Specify location
uv venv /path/to/venv
Pattern 2: Activating Virtual Environments
# Linux/macOS
source .venv/bin/activate

# Windows (Command Prompt)
.venv\Scripts\activate.bat

# Windows (PowerShell)
.venv\Scripts\Activate.ps1

# Or use uv run (no activation needed)
uv run python script.py
uv run pytest
Pattern 3: Using uv run
# Run Python script (auto-activates venv)
uv run python app.py

# Run installed CLI tool
uv run black .
uv run pytest

# Run with specific Python version
uv run --python 3.11 python script.py

# Pass arguments
uv run python script.py --arg value

Package Management

Pattern 4: Adding Dependencies
# Add package (adds to pyproject.toml)
uv add requests

# Add with version constraint
uv add "django>=4.0,<5.0"

# Add multiple packages
uv add numpy pandas matplotlib

# Add dev dependency
uv add --dev pytest pytest-cov

# Add optional dependency group
uv add --optional docs sphinx

# Add from git
uv add git+https://github.com/user/repo.git

# Add from git with specific ref
uv add git+https://github.com/user/[email protected]

# Add from local path
uv add ./local-package

# Add editable local package
uv add -e ./local-package
Pattern 5: Removing Dependencies
# Remove package
uv remove requests

# Remove dev dependency
uv remove --dev pytest

# Remove multiple packages
uv remove numpy pandas matplotlib
Pattern 6: Upgrading Dependencies
# Upgrade specific package
uv add --upgrade requests

# Upgrade all packages
uv sync --upgrade

# Upgrade package to latest
uv add --upgrade requests

# Show what would be upgraded
uv tree --outdated
Pattern 7: Locking Dependencies
# Generate uv.lock file
uv lock

# Update lock file
uv lock --upgrade

# Lock without installing
uv lock --no-install

# Lock specific package
uv lock --upgrade-package requests

Python Version Management

Pattern 8: Installing Python Versions
# Install Python version
uv python install 3.12

# Install multiple versions
uv python install 3.11 3.12 3.13

# Install latest version
uv python install

# List installed versions
uv python list

# Find available versions
uv python list --all-versions
Pattern 9: Setting Python Version
# Set Python version for project
uv python pin 3.12

# This creates/updates .python-version file

# Use specific Python version for command
uv --python 3.11 run python script.py

# Create venv with specific version
uv venv --python 3.12

Project Configuration

Pattern 10: pyproject.toml with uv
[project]
name = "my-project"
version = "0.1.0"
description = "My awesome project"
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
    "requests>=2.31.0",
    "pydantic>=2.0.0",
    "click>=8.1.0",
]

[project.optional-dependencies]
dev = [
    "pytest>=7.4.0",
    "pytest-cov>=4.1.0",
    "black>=23.0.0",
    "ruff>=0.1.0",
    "mypy>=1.5.0",
]
docs = [
    "sphinx>=7.0.0",
    "sphinx-rtd-theme>=1.3.0",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.uv]
dev-dependencies = [
    # Additional dev dependencies managed by uv
]

[tool.uv.sources]
# Custom package sources
my-package = { git = "https://github.com/user/repo.git" }
Pattern 11: Using uv with Existing Projects
# Migrate from requirements.txt
uv add -r requirements.txt

# Migrate from poetry
# Already have pyproject.toml, just use:
uv sync

# Export to requirements.txt
uv pip freeze > requirements.txt

# Export with hashes
uv pip freeze --require-hashes > requirements.txt

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

1---
2name: uv-package-manager
3description: Master the uv package manager for fast Python dependency management, virtual environments, and modern Python project workflows. Use when setting up Python projects, managing dependencies, or optimizing Python development workflows with uv.
4---
5 
6# UV Package Manager
7 
8Comprehensive guide to using uv, an extremely fast Python package installer and resolver written in Rust, for modern Python project management and dependency workflows.
9 
10## When to Use This Skill
11 
12- Setting up new Python projects quickly
13- Managing Python dependencies faster than pip
14- Creating and managing virtual environments
15- Installing Python interpreters
16- Resolving dependency conflicts efficiently
17- Migrating from pip/pip-tools/poetry
18- Speeding up CI/CD pipelines
19- Managing monorepo Python projects
20- Working with lockfiles for reproducible builds
21- Optimizing Docker builds with Python dependencies
22 
23## Core Concepts
24 
25### 1. What is uv?
26 
27- **Ultra-fast package installer**: 10-100x faster than pip
28- **Written in Rust**: Leverages Rust's performance
29- **Drop-in pip replacement**: Compatible with pip workflows
30- **Virtual environment manager**: Create and manage venvs
31- **Python installer**: Download and manage Python versions
32- **Resolver**: Advanced dependency resolution
33- **Lockfile support**: Reproducible installations
34 
35### 2. Key Features
36 
37- Blazing fast installation speeds
38- Disk space efficient with global cache
39- Compatible with pip, pip-tools, poetry
40- Comprehensive dependency resolution
41- Cross-platform support (Linux, macOS, Windows)
42- No Python required for installation
43- Built-in virtual environment support
44 
45### 3. UV vs Traditional Tools
46 
47- **vs pip**: 10-100x faster, better resolver
48- **vs pip-tools**: Faster, simpler, better UX
49- **vs poetry**: Faster, less opinionated, lighter
50- **vs conda**: Faster, Python-focused
51 
52## Installation
53 
54### Quick Install
55 
56```bash
57# macOS/Linux
58curl -LsSf https://astral.sh/uv/install.sh | sh
59 
60# Windows (PowerShell)
61powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
62 
63# Using pip (if you already have Python)
64pip install uv
65 
66# Using Homebrew (macOS)
67brew install uv
68 
69# Using cargo (if you have Rust)
70cargo install --git https://github.com/astral-sh/uv uv
71```
72 
73### Verify Installation
74 
75```bash
76uv --version
77# uv 0.x.x
78```
79 
80## Quick Start
81 
82### Create a New Project
83 
84```bash
85# Create new project with virtual environment
86uv init my-project
87cd my-project
88 
89# Or create in current directory
90uv init .
91 
92# Initialize creates:
93# - .python-version (Python version)
94# - pyproject.toml (project config)
95# - README.md
96# - .gitignore
97```
98 
99### Install Dependencies
100 
101```bash
102# Install packages (creates venv if needed)
103uv add requests pandas
104 
105# Install dev dependencies
106uv add --dev pytest black ruff
107 
108# Install from requirements.txt
109uv pip install -r requirements.txt
110 
111# Install from pyproject.toml
112uv sync
113```
114 
115## Virtual Environment Management
116 
117### Pattern 1: Creating Virtual Environments
118 
119```bash
120# Create virtual environment with uv
121uv venv
122 
123# Create with specific Python version
124uv venv --python 3.12
125 
126# Create with custom name
127uv venv my-env
128 
129# Create with system site packages
130uv venv --system-site-packages
131 
132# Specify location
133uv venv /path/to/venv
134```
135 
136### Pattern 2: Activating Virtual Environments
137 
138```bash
139# Linux/macOS
140source .venv/bin/activate
141 
142# Windows (Command Prompt)
143.venv\Scripts\activate.bat
144 
145# Windows (PowerShell)
146.venv\Scripts\Activate.ps1
147 
148# Or use uv run (no activation needed)
149uv run python script.py
150uv run pytest
151```
152 
153### Pattern 3: Using uv run
154 
155```bash
156# Run Python script (auto-activates venv)
157uv run python app.py
158 
159# Run installed CLI tool
160uv run black .
161uv run pytest
162 
163# Run with specific Python version
164uv run --python 3.11 python script.py
165 
166# Pass arguments
167uv run python script.py --arg value
168```
169 
170## Package Management
171 
172### Pattern 4: Adding Dependencies
173 
174```bash
175# Add package (adds to pyproject.toml)
176uv add requests
177 
178# Add with version constraint
179uv add "django>=4.0,<5.0"
180 
181# Add multiple packages
182uv add numpy pandas matplotlib
183 
184# Add dev dependency
185uv add --dev pytest pytest-cov
186 
187# Add optional dependency group
188uv add --optional docs sphinx
189 
190# Add from git
191uv add git+https://github.com/user/repo.git
192 
193# Add from git with specific ref
194uv add git+https://github.com/user/[email protected]
195 
196# Add from local path
197uv add ./local-package
198 
199# Add editable local package
200uv add -e ./local-package
201```
202 
203### Pattern 5: Removing Dependencies
204 
205```bash
206# Remove package
207uv remove requests
208 
209# Remove dev dependency
210uv remove --dev pytest
211 
212# Remove multiple packages
213uv remove numpy pandas matplotlib
214```
215 
216### Pattern 6: Upgrading Dependencies
217 
218```bash
219# Upgrade specific package
220uv add --upgrade requests
221 
222# Upgrade all packages
223uv sync --upgrade
224 
225# Upgrade package to latest
226uv add --upgrade requests
227 
228# Show what would be upgraded
229uv tree --outdated
230```
231 
232### Pattern 7: Locking Dependencies
233 
234```bash
235# Generate uv.lock file
236uv lock
237 
238# Update lock file
239uv lock --upgrade
240 
241# Lock without installing
242uv lock --no-install
243 
244# Lock specific package
245uv lock --upgrade-package requests
246```
247 
248## Python Version Management
249 
250### Pattern 8: Installing Python Versions
251 
252```bash
253# Install Python version
254uv python install 3.12
255 
256# Install multiple versions
257uv python install 3.11 3.12 3.13
258 
259# Install latest version
260uv python install
261 
262# List installed versions
263uv python list
264 
265# Find available versions
266uv python list --all-versions
267```
268 
269### Pattern 9: Setting Python Version
270 
271```bash
272# Set Python version for project
273uv python pin 3.12
274 
275# This creates/updates .python-version file
276 
277# Use specific Python version for command
278uv --python 3.11 run python script.py
279 
280# Create venv with specific version
281uv venv --python 3.12
282```
283 
284## Project Configuration
285 
286### Pattern 10: pyproject.toml with uv
287 
288```toml
289[project]
290name = "my-project"
291version = "0.1.0"
292description = "My awesome project"
293readme = "README.md"
294requires-python = ">=3.8"
295dependencies = [
296 "requests>=2.31.0",
297 "pydantic>=2.0.0",
298 "click>=8.1.0",
299]
300 
301[project.optional-dependencies]
302dev = [
303 "pytest>=7.4.0",
304 "pytest-cov>=4.1.0",
305 "black>=23.0.0",
306 "ruff>=0.1.0",
307 "mypy>=1.5.0",
308]
309docs = [
310 "sphinx>=7.0.0",
311 "sphinx-rtd-theme>=1.3.0",
312]
313 
314[build-system]
315requires = ["hatchling"]
316build-backend = "hatchling.build"
317 
318[tool.uv]
319dev-dependencies = [
320 # Additional dev dependencies managed by uv
321]
322 
323[tool.uv.sources]
324# Custom package sources
325my-package = { git = "https://github.com/user/repo.git" }
326```
327 
328### Pattern 11: Using uv with Existing Projects
329 
330```bash
331# Migrate from requirements.txt
332uv add -r requirements.txt
333 
334# Migrate from poetry
335# Already have pyproject.toml, just use:
336uv sync
337 
338# Export to requirements.txt
339uv pip freeze > requirements.txt
340 
341# Export with hashes
342uv pip freeze --require-hashes > requirements.txt
343```
344 
345For 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](references/advanced-patterns.md)
346 
View all files on GitHub →

Details

Updated
Sep 21, 2026
License
MIT
Stars on the repo
★ 39,857
Checked
Source
wshobson/agents ↗
Creator
wshobson · 179 listings
View creator

Similar skills

See all →
SkillExtract text, tables, metadataXberg Document Extractionxberg-io/xberg · by xberg-ioExtract text, tables, metadata, and images from 107 document formats (PDF, Office, images, HTML, email, archives, academic) using Xberg. Use when writing code that calls Xberg APIs in Python, Node.js/TypeScript, Rust, or CLI. Covers installation, extraction (sync/async), configuration (OCR, chunking, output format), batch processing, error handling, and plugins.★ 9.4k GitHub starsSkillMove code from one implementation to another functionCode migrationkucherenko/jscpd · by kucherenkoMove code from one implementation to another function by function, tests first and code second, and check two implementations of one app for parity, with jscpd --compare as the progress measure and a coverage map binding each function to its tests. Use when porting a library or app to another language or framework (Java to Kotlin, JavaScript to Rust, a Python library to TypeScript, an iOS app to Android), when asked what is left to port, or when comparing the Android and iOS versions of an app.★ 6.3k GitHub starsSkillManages Ahrefs API usage in Python using ahrefs-pythonOpenClaudia/openclaudia-skills · by OpenClaudiaManages Ahrefs API usage in Python using `ahrefs-python` library. Use when working with SEO / marketing related tasks or with data including backlinks, keywords, domain ratings, organic traffic, site audits, rank tracking, and brand monitoring. Covers `ahrefs-python` usage including AhrefsClient / AsyncAhrefsClient, typed request/response models, error handling, and all API sections.★ 705 GitHub starsMCPDocx LLM translatoradeudealfluence/adeu · by dealfluenceDocx ↔ LLM translator. Projects .docx office files to Markdown for editing. Projects edits back to OOXML as tracked changes (redlines). Python and Node.js implementations.★ 165 GitHub starsSkillCreate an Amazon-compliant white-background main imageAmazon White-Background Main Image · 亚马逊白底主图xianyu110/ecommerce-image-skills · by xianyu110Create an Amazon-compliant white-background main image (pure #FFFFFF background, product fills ≥85% of the frame, no text, props or watermark) from a product photo with GPT Image 2.5, then verify it with a Python check script. Use for Amazon/Walmart/eBay main images, 白底图, 白底主图, hero image, listing main photo.★ 92 GitHub starsMCPOfficial monorepo of SDKs, CLISendmux sdkSendmux/sendmux-sdk · by SendmuxOfficial monorepo of SDKs, CLI, and MCP servers for Sendmux email APIs across TypeScript, Python, Go, PHP, Rust, and Ruby.★ 65 GitHub stars

More from wshobson

SkillMaster C/.NET backend development patterns for buildingwshobson/agents · by wshobsonMaster C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.★ 39.9k GitHub starsSkillImplement WCAG 2.2 compliant interfaces with mobileAccessibility compliancewshobson/agents · by wshobsonImplement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support. Use when auditing accessibility, implementing ARIA patterns, building for screen readers, or ensuring inclusive user experiences.★ 39.9k GitHub starsSkillMaster Material Design 3 and Jetpack Compose patternsAndroid Mobile Designwshobson/agents · by wshobsonMaster Material Design 3 and Jetpack Compose patterns for building native Android apps. Use when designing Android interfaces, implementing Compose UI, or following Google's Material Design guidelines.★ 39.9k GitHub starsSkillMigrate from AngularJS to Angular using hybrid modeAngular migrationwshobson/agents · by wshobsonMigrate from AngularJS to Angular using hybrid mode, incremental component rewriting, and dependency injection updates. Use when upgrading AngularJS applications, planning framework migrations, or modernizing legacy Angular code.★ 39.9k GitHub starsSkillUnderstand anti-reversing, obfuscationAnti reversing techniqueswshobson/agents · by wshobsonUnderstand anti-reversing, obfuscation, and protection techniques encountered during software analysis. Use this skill when analyzing malware evasion techniques, when implementing anti-debugging protections for CTF challenges, when reverse engineering packed binaries, or when building security research tools that need to detect virtualized environments.★ 39.9k GitHub starsSkillBuild production Apache Airflow DAGs with best practicesApache Airflow DAG Patternswshobson/agents · by wshobsonBuild production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workflows, or scheduling batch jobs.★ 39.9k GitHub stars