Skip to main content
This course uses uv for all Python dependency management. Written in Rust, uv is 10-100x faster than pip and replaces multiple tools, pip, pip-tools, pipx, poetry, pyenv, and virtualenv, with a single binary.

Installing uv

Inside the course Docker containers, uv is already installed. You only need to install it locally if you are working outside Docker.

Managing Python versions

uv can install and manage Python versions directly, no need for pyenv or system package managers:

Virtual environments

uv creates and manages virtual environments:
The virtual environment is created in .venv/ by default. Activate it with:
Do not commit the .venv folder to your GitHub repo. The repository’s .gitignore already excludes it.

Installing packages

uv provides a pip-compatible interface for installing packages:

Project management

For projects with a pyproject.toml (like the course repository), uv provides higher-level commands:
The uv.lock file is a cross-platform lockfile that ensures reproducible installs across machines and operating systems.

Course workflow

Inside the course Docker container, dependencies are pre-installed. The typical workflow is:
If you need to add a package for your assignment or project:

Why uv over pip or conda

Avoid conda environments in this course. They conflict with the optimized NVIDIA containers and create dependency resolution issues with pre-installed PyTorch packages.

Useful commands reference

For the full documentation, see docs.astral.sh/uv.