Install Python with uv
Skip system Python. Install uv, then use uv to manage Python versions and per-project virtual environments. Verify with uv python list.

macOS and most Linux distros ship a system Python you should leave alone — it belongs to the OS, and pip install against it will eventually break something the OS depends on. Use uv instead. It installs Python versions on demand, manages per-project virtual envs, and replaces pip, pip-tools, pyenv, virtualenv, and poetry with a single binary written in Rust. This post covers installing uv itself and using it to install Python.
macOS and Linux
The official installer is a single shell command. It drops uv into ~/.local/bin.
# install uv via the official script
curl -LsSf https://astral.sh/uv/install.sh | sh
On macOS you can also use Homebrew:
# install uv via homebrew
brew install uv
If you don't have Homebrew yet, see Install Homebrew.
Windows
Use the PowerShell installer or winget.
# install uv via the official script on windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# install uv via winget
winget install --id=astral-sh.uv -e
Install a Python version with uv
Don't brew install python or download the official .pkg. Let uv manage Python versions the same way fnm manages Node versions.
# list python versions uv can install
uv python list
# install python 3.12
uv python install 3.12
For a new project, pin the version in a virtual env:
# create a project with python 3.12
uv init my-project --python 3.12 && cd my-project
# add a dependency, like the anthropic sdk
uv add anthropic
uv writes a pyproject.toml and a lockfile, and creates .venv/ automatically. To run code inside the env:
# run a script using the project's venv
uv run python script.py
Verify
# check uv version and installed pythons
uv --version && uv python list --only-installed
You should see uv 0.4+ and at least one Python listed.
Common gotchas
- Don't mix
pip installanduv add: pick one per project.uv addwrites topyproject.toml;pip installdoesn't, so dependencies installed that way disappear on a clean rebuild. - Global tools: install command-line Python tools with
uv tool install <pkg>(e.g.ruff,pre-commit). It puts them on PATH without polluting any project venv. - Activating venvs: you usually don't need to.
uv runhandles it. If a tool insists onsource .venv/bin/activate, that still works. requirements.txtprojects:uv pip install -r requirements.txtworks as a drop-in for legacy projects you don't want to migrate yet.
With uv installed you can skip every other Python install guide on the internet — uv python install <version> covers all of them.
Rate this article
How helpful did you find this?
- 01
Install Homebrew
February 15, 2026
- 02
Install Git
February 16, 2026
- 03
Install Node.js and npm
February 17, 2026
- 04
Install Python with uv
February 18, 2026
- 05
Install Docker
February 19, 2026
- 06
Install Ollama
February 20, 2026
- 07
Install llama.cpp
February 21, 2026
- 08
Install LM Studio
February 22, 2026
- 09
Install the Anthropic SDK
February 23, 2026
- 10
Install the OpenAI SDK
February 23, 2026
Newsletter
Get new articles in your inbox
AI engineering, LLM systems, and software architecture — no filler.
No spam. Unsubscribe any time.
Discussion
Comments
Leave a note about the article, architecture choices, or what you would build next.
Loading comments...