Module 2 Setup (Check This First)
Module 2 runs on the machine Module 0's setup page built: a Unix terminal (WSL on Windows), uv, Python 3.12.8 inside the (bootcamp) environment at ~/dev/bootcamp, and VS Code opened on that folder with the Python extension. Unlike Module 1, this module installs libraries into (bootcamp), each in the lesson that first uses it. This page explains how a library gets into an environment that has no pip, fixes where Module 2's files live, and ends with a checklist that must pass before Lesson 2.1.1.
By the end of this page you will have:
- Confirmed that
(bootcamp)still answers with Python 3.12.8 and holds no library yet - The one install command this module uses, and the lesson where each install happens
- One fixed home for Module 2's scripts, its databases, its charts and its data files
If you are starting here
Module 2 assumes every step of Module 0's setup page. If you skipped the earlier modules because you already work in a terminal and write Python, do that page first, start to finish, then come back here. It is free, and the checklist below fails without it.
Where Module 2's files live
Every script a Module 2 lesson asks you to write goes straight into ~/dev/bootcamp, saved under the exact name the lesson gives it, and runs from there with python3 followed by that name, exactly as in Module 1. What those scripts create lands beside them: the SQLite database files Section 2.1 and Lesson 2.4.3 build, housing.db and listings.db, and every chart Section 2.7 saves as a .png file, which you open from VS Code's file explorer.
From Lesson 2.4.1 on, the lessons read the course's housing dataset, four files provided with the course as downloads: housing.csv, housing.json, housing.xlsx and regions.csv. They live in the course's GitHub repository, in data/m2/, where opening a file and pressing its Download raw file button saves it. The lesson that first opens each file names it, and each one goes into ~/dev/bootcamp, beside your scripts, because a script opens a bare file name in the folder it runs from. A browser saves a download into your Downloads folder, so copy or move it from there. On Windows that folder belongs to Windows, and WSL reaches it through /mnt/c, as Lesson 0.1.3 showed:
# Windows, with WSL: for a Windows user named goku
cp /mnt/c/Users/goku/Downloads/housing.csv ~/dev/bootcamp/
# macOS and Linux
mv ~/Downloads/housing.csv ~/dev/bootcamp/The capstone creates a folder of its own and says so.
DON'T:
- DON'T leave a dataset file in Downloads and point a script at it by its full path. Every lesson's code opens the file by its bare name, so each script would need that path edited in, and on Windows each read would cross the
/mnt/cboundary that Module 0's setup page calls slow. - DON'T edit a dataset file by hand, not even to fix a value that looks wrong. The lessons count its missing values, duplicates and outliers, which are there on purpose, and one changed cell changes the numbers you compare against.
Installing into (bootcamp)
(bootcamp) has no pip of its own, because uv venv builds an environment without one, so a pip install with (bootcamp) active fails before it starts: the shell reports that pip is not found. The tool that installs into it is uv itself. uv pip install is uv's own installer, it takes the same arguments pip install does, and it installs into the active environment. Each install lesson runs it with an exact version after ==, because those versions produced every result the lessons print, and another release can print something different.
| Library | Version | Installed in |
|---|---|---|
| NumPy, fast numeric arrays | 2.5.2 | Lesson 2.2.1 |
| pandas, labeled tables | 3.0.5 | Lesson 2.4.1 |
| openpyxl, which pandas uses to read and write Excel files | 3.1.5 | Lesson 2.4.3 |
| matplotlib and seaborn, charts | 3.11.1 and 0.13.2 | Lesson 2.7.2 |
SQLite, the database Section 2.1 queries, needs no install: Python's standard library carries it as the sqlite3 module. uv pip list prints what an environment holds, and in a (bootcamp) no install has touched yet it prints nothing at all.
DON'T:
- DON'T install a library before the lesson that installs it. Nothing breaks, but you lose the failure Lessons 2.2.1, 2.4.1 and 2.4.3 show before their install, and the install command itself is part of what each install lesson teaches.
- DON'T drop the
==and its version. A bareuv pip install pandasinstalls the newest release on the day you run it, which is not the release every printed result in this module came from. - DON'T run
uv pip installfrom a folder outside~/dev/bootcampwith no environment active. uv installs into the active environment, and with none active into a.venvin the current folder or the nearest folder above it, so from Lesson 1.7.3's~/projectit installs into that project's environment instead of(bootcamp), and from a folder with no.venvin it or above it, such as~, it refuses withNo virtual environment found. Run it in~/dev/bootcampwith(bootcamp)active, as every lesson does.
Every session starts the same way
Open VS Code on ~/dev/bootcamp, open its built-in terminal, and look at the prompt. It must start with (bootcamp). If it does not, activate the environment:
cd ~/dev/bootcamp && source .venv/bin/activateSetup checklist (pass ALL of these before Lesson 2.1.1, uv pip list aside)
Open a fresh terminal, then run:
cd ~/dev/bootcamp
source .venv/bin/activate
python3 --version # Python 3.12.8
# /home/goku/dev/bootcamp/.venv/bin/python3 (macOS: /Users/goku/dev/bootcamp/.venv/bin/python3)
which python3
uv pip list # prints nothing, no library is installed yet
# 3.47.1, the SQLite version inside Python 3.12.8
python3 -c "import sqlite3; print(sqlite3.sqlite_version)"Your prompt must show (bootcamp) the whole time, and every line of Module 0's setup checklist must still pass as well. If uv pip list prints libraries, something was installed into (bootcamp) along the way: the lessons still run, though a library no lesson installs can change what they print, as Lesson 2.5.2 shows for pyarrow, and an install line in Lessons 2.2.1, 2.4.1, 2.4.3 and 2.7.2 prints no + line for a library it names that is already there at that version, and replaces one there at another version, printing a - line for the old version above the + line for the new. If any other line fails, Module 0's setup page is where it gets fixed. Do not start Lesson 2.1.1 until every line but uv pip list passes.