Lab 4 of 5
Β·
Semi-Guided
Recreate a Virtual Environment from requirements.txt
Objective: Create a fresh venv and install all dependencies from the requirements.txt you generated.
Instructions
Simulate deploying your project to a new machine by creating a second venv from the requirements file you generated in Lab 3.
In your terminal (from the lab12/ directory):
deactivate
python3 -m venv venv2
source venv2/bin/activate
pip install -r requirements.txt
pip list
pip list will show all the installed packages. It must include requests.
Paste the line from pip list that shows requests and its version, and the line that shows pip itself:
pip 24.x
requests 2.x.x
Your exact versions will differ. Submit your actual two lines.
π‘ Show Hint
After "source venv2/bin/activate", your prompt should show (venv2). pip install -r requirements.txt reads the file and installs every package at the pinned version. pip list shows all installed packages in alphabetical order.
Paste Your Output