Python 5.2Code walkthrough9 parts

uv, Packages and Environments

Install Python and packages for a project without breaking other projects.

Loading your progress…Next: 5.3 Working with Files

In this lesson9 parts

  1. 01Why your own computer, and two projects with two versions
  2. 02Installing uv, and Python
  3. 03A project
  4. 04The virtual environment
  5. 05Adding a package
  6. 06What uv does underneath
  7. 07Our code in the project, and Jupyter
  8. 08Where environments mislead
  9. 09Recap, your challenge, and next

Key terms

The words this lesson introduces, each in one line. The module’s glossary collects them all.

dependency
A package a project needs, listed in pyproject.toml.
lockfile
A file recording the exact version of every dependency: uv.lock.
project
A folder of code with a pyproject.toml that describes it.
terminal
A window where you type commands for the computer, one line at a time: Terminal on macOS, PowerShell on Windows.
virtual environment
A folder with its own Python and its own installed packages, for one project: .venv.

Quiz 5 questions

Your first pick on each question is the one that counts, and a right one earns a coin. Getting one wrong here is how the lesson sticks.

Practice

Problems to solve in your own notebook. Each states the problem, not the steps: working out the steps is the exercise. Level A applies the lesson, B combines it with earlier ones, C stretches it.

Common mistakes

What you will see when it goes wrong, why it happens, and the fix.

Where it’s used

Where this lesson’s ideas turn up in real work.