Skip to content

⚡ uv

uv is an extremely fast, unified Python package and project manager written in Rust. It serves as a drop-in replacement for pip, pip-tools, pipx, poetry, pyenv, virtualenv, and more.

🛠 Installation

You can install uv using Astral's standalone installer, or via package managers.

curl -LsSf https://astral.sh/uv/install.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
brew install uv
pip install uv
# or
pipx install uv

⚙ Config

uv can be configured globally using a uv.toml or per-project in pyproject.toml under the [tool.uv] table.

pyproject.toml

[tool.uv]
dev-dependencies = [
    "pytest>=8.0.0",
]

📝 Usage

Project Management

1. Initialize a new project

uv init my-project

2. Add dependencies

uv add requests

3. Run a script/command in the environment

uv run python main.py

4. Lock and sync dependencies

uv sync

Pip-Compatible Interface

uv provides a fast alternative to standard pip commands under the uv pip namespace.

1. Create a virtual environment

uv venv

2. Install packages

uv pip install -r requirements.txt

3. Compile dependencies

uv pip compile pyproject.toml -o requirements.txt

🔗 References