Lesson 4: pip and virtual environments, packages kept per project
13 min read·14 Oct 2026
Module 7 · Lesson 4 · About 45 minutes · Needs: Module 7 Lessons 1 to 3 (import, the standard library), and!pythonfrom Module 1 Lesson 2
The situation
Everything Booknook has used so far came with Python. Module 10 tests the shelf's rules with pytest, a tool that does not: it must be fetched from the internet and installed.
Amira adds a condition. "Tom will run the tests on the café laptop, and you run them in Colab. I want both of you to get the same answer." That means the same pytest, at the same version, on both computers, without disturbing anything else on them.
This lesson follows one package, pytest 9.1.1, from the internet into a private folder made for Booknook alone.