Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

uv

uvΒΆ


πŸ“¦ Installation

Install

curl -LsSf https://astral.sh/uv/install.sh | sh
uv --version

Update

uv self update
πŸš€ Basic Commands
uv --help
uv init
uv add requests
uv remove requests
uv sync
uv run python -V
πŸ“ Project Management

Create a project

uv init myapp
cd myapp

Add dependencies

uv add fastapi
uv add "requests>=2.31"

Remove dependencies

uv remove fastapi
🐍 Python Version Management
uv python list
uv python install 3.12
uv python pin 3.12
uv python use 3.12
πŸ“œ Scripts & Tools

Run scripts

uv run python app.py
uv run pytest

Run tools without installing

uvx ruff check .
uvx black .
πŸ”’ Lockfiles & Reproducibility
uv lock
uv sync --frozen
uv export -o requirements.txt