Your .venv is a folder in one directory. Walk away from it and it is gone.

Last session ended with a working virtual environment and requests installed into it. That environment is a folder called .venv inside one project directory — not a setting on your machine, and not something your terminal remembers. A brand-new terminal starts outside it. A cd anywhere else leaves it behind.

So the first thing you do, every session: walk back into the directory and switch it on. Re-running python3 -m venv .venv on a venv that already exists is safe and keeps what you installed. python -c runs the code you hand it instead of running a file.

You do
mkdir -p ~/wk2 && cd ~/wk2
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -q requests
python -c "import requests; print(requests.__version__)"

Expect 2.32 or newer — which version you get depends on your Python, so the number on your screen may be lower than the one on the projector and still be right.

Hands up if that last line is not a version number at all.

1/31 exit