Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Using uv for Python

Using uv for environment and package management as a all-in-one replacement for pip, pip-tools etc.

Create a new Virtual environment

# create new virtual env in a folder .venv
uv venv .venv

# create new virtual env with pip installed
uv venv --seed

Activate the virtual environment

source .venv/bin/activate

Install dependencies using uv add

uv add numpy pandas

# or using their pip compatible interface,
uv pip install numpy pandas

Run a python project with environment setup directly with uv

uv run ./path/to/project-file.py