You need one thing for this course: a Python environment that runs the lab notebooks. You don’t need an account, an API key, or a network connection after the packages are installed, because no part of the course calls a language model. Set the environment up before you start Module 1. The commands below are for Linux and macOS; on Windows, run them inside the Windows Subsystem for Linux (WSL).
Run every command from the root folder of the repository that holds the course, the folder with
requirements.txt in it.
The notebook environment¶
The labs are Jupyter notebooks in Python 3.12. Besides Jupyter, they use four packages:
matplotlib for figures, jsonschema to check structured output, PyYAML to read the front matter of
configuration files, and promptlab, a small package written for this course. promptlab holds
the stand-ins that answer the labs’ requests in place of a model, and the loaders for the course’s
data.
Install Python 3.12 and uv, a Python package installer.
Create the environment and install the course’s packages:
uv venv .venv --python 3.12VIRTUAL_ENV=.venv uv pip install -r requirements.txtThe second command ends by listing the packages it installed. It installs
promptlabfrom the course’s folder in editable mode (-e), so the labs use the copy incourses/pe101/promptlab/that you can read.Check
promptlabwith its own tests:.venv/bin/pytest -q courses/pe101/promptlabThe last line reports how many tests passed, and none failed.
Start JupyterLab:
.venv/bin/jupyter labJupyterLab opens in your browser.
Open the first lab,
courses/pe101/modules/01-how-models-produce-text/lab01.ipynb, and run its setup cell. It prints the versions of Python and the packages the lab uses.
Running a lab¶
Run a lab’s cells in order, from the top. If you change an earlier cell, run it again before the cells after it.
Each exercise ends with a check cell. Run it after your answer: it prints
passed, or it fails with a message that says what is wrong. Until you answer an exercise, its check fails on purpose.To start a lab over, choose Kernel > Restart Kernel and Clear Outputs of All Cells in JupyterLab, then run the cells again from the top.
Labs never send anything over the network. Where a lab says “the model” answers, a stand-in from
promptlabanswers from a script, and the lab says so.
No coding agent needed¶
Modules 12 and 13 teach you to prompt and configure Claude Code, a coding agent. Their labs run offline too, with every check done in code, so you don’t need Claude Code installed, and the course never asks you to run it.