Dependencies and environments with uv
Dependencies and environments with uv
A Python environment is a directory containing an interpreter and the packages installed for it. The reason projects each get their own is that two projects on one machine will eventually want different versions of the same package, and a single shared install cannot hold both. That is the whole problem, and every tool in this space is a way of creating those directories and filling them correctly.
uv is the tool this course uses because it does all of it in one place: it installs Python itself, creates the environment, resolves and installs packages, writes a lock file, and runs commands inside the environment without you activating anything. It replaces pip, venv, pyenv, pipx and pip-tools, and it is fast enough that "reinstall from scratch" is a normal thing to do rather than a last resort.
Continue reading
Pro unlocks every video lesson, the full notes and runnable code across the Python with AI course, from the language itself to agents, MCP, Langfuse and deployment.