Python Setup
This guide covers how I manage Python for projects using uv (fast Python/packaging tool).
Requirements
- uv installed — see the uv page
Install / Select Python versions
Install specific versions
uv python install 3.12
uv python install 3.11 3.12
Pin a project to a version (writes .python-version)
uv python pin 3.12
Create & activate a virtual environment
uv venv
source .venv/bin/activate
explicit specify python version and venv folder
uv venv --python 3.12 .venv312
source .venv312/bin/activate
Packages (pip interface)
Install a package
uv pip install PACKAGE
Upgrade a package
uv pip install -U PACKAGE
Editable install (from a local repo)
uv pip install -e .
Tools: uvx
and persistent installs uv tools
Run a tool once (ephemeral)
uvx ruff --version
uvx httpie --help
Install a tool persistently and use it
uv tool install ruff
ruff --version
Run a specific version or alternate source
uvx ruff@latest check
uvx --from git+https://github.com/httpie/cli httpie --help
If a tool isn’t on your PATH after install
uv tool update-shell