uv: The Fast Python Package and Project Manager
Key Features of uv
- Speed: Up to 100x faster than pip and traditional Python tools for installing and resolving dependencies, thanks to its Rust-based core.
- Unified Toolchain: Manages packages, creates virtual environments, installs Python versions, scaffolds projects, locks dependencies, and more—all in one tool.
- Drop-in Replacement: Can be used in place of pip/pip-tools; supports pyproject.toml projects, lockfile management, and developer tooling installation.
- Efficient Workflow: Automatically creates and syncs virtual environments, tracks direct vs. transitive dependencies, and provides reproducible environments for teams.
- Cross-Platform: Runs natively on macOS, Linux, and Windows.
How to Install and Use uv
Installation:
- Install via Homebrew (macOS):
brew install uv - Or use other methods (curl, pipx, see official docs).
Basic Usage Patterns:
-
Create new project
- Command Example:
uv init - Description: Initializes a new Python project (pyproject.toml, README, virtualenv, etc)
- Command Example:
-
Add package to project
- Command Example:
uv add requests - Description: Adds a dependency to the project
- Command Example:
-
Remove package from project
- Command Example:
uv remove requests - Description: Removes a dependency from the project
- Command Example:
-
Sync environment
- Command Example:
uv sync - Description: Installs/updates requirements and syncs your virtual environment
- Command Example:
-
Install Python version
- Command Example:
uv python install 3.12 - Description: Installs Python (like pyenv)
- Command Example:
-
Lock dependencies
- Command Example:
uv lock - Description: Creates/updates a lockfile for reproducible installs
- Command Example:
-
Build/publish package
- Command Example:
uv build/uv publish - Description: Builds a distributable archive or uploads to PyPI
- Command Example:
-
Show dependency tree
- Command Example:
uv tree - Description: Prints full dependency graph
- Command Example:
For Pip-Like Installs (in virtualenv):
- Install a package:
uv pip install numpy - Show packages:
uv pip list
Why Use uv?
- Drastically reduces install and sync times for dependencies and project setup.
- Establishes modern project management practices for Python, lowering complexity for large and collaborative codebases.
- Simplifies onboarding and environment replication across systems and teams.