Getting your computer ready for notebooks, code, GIS, and lab work on Windows, macOS, Linux, and Raspberry Pi
This book is designed so that much of the learning can happen directly on the page. You can read, think, and often experiment without needing a complicated local setup.
But some of the labs and companion projects work better when you have your own environment ready:
The good news is that your setup does not need to be fancy. It needs to be stable, understandable, and easy to recover when something goes wrong.
For most readers, a good starter environment includes:
If you want to go further into spatial labs, it is also useful to have:
Do not install everything globally if you can avoid it.
Instead, aim for:
This makes it much easier to fix problems later.
If you want the short version, this is the recommended starter stack:
That stack is not the only good one. It is simply a practical one with lots of documentation and low friction for beginners.
Windows is perfectly usable for this work, but it helps to be deliberate.
VS CodeGit for WindowsPython 3 from the official Python sitePATHJupyterLabQGISYou can use:
Recommended:
Windows Terminal plus PowerShellThat gives a cleaner and more modern experience.
Open a terminal and run:
python --versionor, on some Windows systems:
py --versionIf that prints a Python version, your install is visible.
Inside a project folder:
python -m venv .venvActivate it in PowerShell:
.\.venv\Scripts\Activate.ps1Then install JupyterLab:
python -m pip install jupyterlabBeginners often run into problems because:
python is not on PATHIf things get messy, a clean reinstall plus a fresh virtual environment is often faster than debugging for hours.
macOS is usually a smooth platform for this kind of work.
VS CodeHomebrewGit if it is not already presentPython 3JupyterLabQGISIn the terminal:
git --versionIf Git is not installed, macOS may prompt you to install command-line developer tools.
Use:
python3 --versionOn macOS, python3 is usually safer than python.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install jupyterlabDo not depend on the old system Python for learning projects.
It is better to use your own Python installation and your own project environments.
Linux is often the easiest platform for reproducible scientific and technical work, especially if you become comfortable with the terminal.
VS Code or another editor you likegit is installedpython3python3-venvpipJupyterLabQGISOn Debian or Ubuntu style systems:
sudo apt update
sudo apt install python3 python3-venv python3-pip gitThen, in your project folder:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install jupyterlabPackage names and install commands vary across distributions. The general pattern matters more than memorizing one exact command.
You want:
The Raspberry Pi deserves special attention because it is such a good learning machine.
It is inexpensive, tangible, and excellent for teaching the idea that computing environments are built, not magical.
It is also more resource-constrained than a laptop or desktop, so your setup choices matter more.
A Pi is great for:
It is less ideal for:
Example:
sudo apt update
sudo apt upgrade -y
sudo apt install python3 python3-venv python3-pip gitThen:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install jupyterlabMove to a laptop, desktop, or remote server when:
That is not failure. It just means the scale of the problem has changed.
A simple project structure helps a lot.
For example:
geography-work/
├── notes/
├── labs/
│ ├── lab-01/
│ ├── lab-02/
│ └── ...
├── data/
└── scratch/
Within a single lab:
lab-01/
├── README.md
├── notebooks/
├── data/
├── outputs/
└── .venv/
This is not the only good structure, but it helps you separate:
If you are trying not to overwhelm yourself, install in this order:
That is enough to begin.
Before starting labs, make sure you can do all of these:
python --version
git --versionor on systems where needed:
python3 --version
git --versionThen try:
python -m pip --versionand:
jupyter labIf those work, you are in good shape.
A clean, boring setup is better than an advanced, confusing one.
If you want the shortest possible answer:
That is enough to start almost all of the companion lab work successfully.