uv Python Package Manager
Purpose
Use uv instead of pip/venv for Python dependency management. 10-100x faster than pip.
When to Use
- User says: "install package", "create venv", "manage dependencies"
- File pattern:
pyproject.toml,uv.lock,.python-version - Context: any Python project setup or dependency management
Commands
uv venv— create virtual environmentuv pip install <pkg>— install packages (pip-compatible)uv add <pkg>— add to pyproject.toml and installuv sync— install all dependencies from lockfileuv run <script>— run script in project environmentuv python install 3.12— install Python versionuv tool install <pkg>— install CLI tools globally
Constraints
- Prefer
uv addoveruv pip installfor project dependencies - Use
uv.lockfor reproducible installs - Check
.python-versionbefore creating venvs