What is uv?
uv is an extremely fast Python package and project manager built by Astral (the team behind Ruff). It replaces pip, venv, pyenv, and more in a single tool.
Install uv
macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | shWindows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Homebrew
brew install uvVerify Installation
uv --versionInstall Python via uv
You don’t need to install Python separately — uv handles it:
uv python install 3.12Check available versions:
uv python listCreate a Project
uv init my-project
cd my-projectThis creates a project with pyproject.toml and a .python-version file.
Add Dependencies
uv add flask
uv add fastapi uvicornDependencies are tracked in pyproject.toml and locked in uv.lock.
Run Your Code
uv run python main.py
uv run flask runuv run automatically creates and manages the virtual environment for you — no manual source venv/bin/activate needed.
Why uv?
- Installs packages 10-100x faster than pip
- Manages Python versions (replaces pyenv)
- Handles virtual environments automatically
- Single
pyproject.tomlfor everything - Drop-in replacement: already familiar commands