This guide gets your own laptop ready for the workshops and the Lab Assessment. You need two things installed: Python (the language) and VS Code (the editor you’ll write and run it in). Do this before your first workshop if you can — it takes about 15–20 minutes.
You only need to do this once. The lab computers already have everything installed, so this guide is for your own laptop only.
Go to python.org/downloads and click the yellow “Download Python” button.
Run the installer.
Important: on the very first screen, tick the box at the bottom that says “Add python.exe to PATH”. This is the single most common thing people forget, and it will cause problems later if you skip it.
Click Install Now and let it finish.
Check it worked: open the Start Menu, type
cmd, press Enter to open Command Prompt, then type:
python --version
You should see something like Python 3.12.x. If instead
you get “not recognised”, see Troubleshooting below.
Go to python.org/downloads and download the macOS installer (the yellow button).
Open the downloaded .pkg file and go through the
installer with the default options.
Check it worked: open Terminal (press
Cmd+Space, type “Terminal”, press Enter), then type:
python3 --version
You should see something like Python 3.12.x. On a Mac,
always use python3, not python — plain
python may point to an old system version or nothing at
all.
Same for both Windows and Mac:
Inside VS Code:
That’s it — these two extensions let VS Code run both
.ipynb notebooks and .py files
cell-by-cell.
Open a terminal inside VS Code: menu Terminal → New Terminal. Then run:
Windows:
pip install numpy pandas matplotlib scikit-learn scipy statsmodels jupyter
Mac:
pip3 install numpy pandas matplotlib scikit-learn scipy statsmodels jupyter
This will take a minute or two. A few weeks (e.g. the neural networks
workshop) need one extra package, tensorflow — you’ll be
told when that’s needed, and the same
pip/pip3 install pattern applies.
Create a new file called test.py anywhere convenient
(e.g. your Desktop) and open it in VS Code.
Type the following into it:
# %%
import pandas as pd
import matplotlib.pyplot as plt
df = pd.DataFrame({"x": [1, 2, 3], "y": [4, 9, 16]})
print(df)
df.plot(x="x", y="y", marker="o")
plt.show()VS Code should show a “Run Cell” link just above
the # %% line — click it (or press
Shift+Enter).
The first time you run a cell, VS Code may ask you to select a Python interpreter — choose the one that shows a version number (e.g. “Python 3.12.x”).
You should see a small table printed and a line chart appear in a new panel.
If you see the table and the chart, you’re fully set up. Delete
test.py — it was only for testing.
| Problem | Fix |
|---|---|
Windows:
'python' is not recognized as an internal or external command |
You likely missed the “Add python.exe to PATH” checkbox during install. Uninstall Python, reinstall, and make sure to tick that box this time. |
Mac: command not found: python |
Use python3 instead of python — this is
normal and expected on a Mac. Same for pip3 instead of
pip. |
VS Code doesn’t show “Run Cell” above # %% |
The Jupyter extension isn’t installed, or VS Code needs a restart after installing it. Check Step 3. |
| Running a cell asks you to “select a kernel” or “select interpreter” and nothing shows up | Python itself isn’t installed correctly, or VS Code can’t find it — redo Step 1, then fully close and reopen VS Code. |
pip install fails with a permissions error |
Add --user to the command,
e.g. pip install --user numpy pandas matplotlib scikit-learn scipy statsmodels jupyter. |
ModuleNotFoundError: No module named 'pandas' (or
similar) when running a cell |
The packages installed to a different Python than the one VS Code is
using. Open the Command Palette (Ctrl+Shift+P /
Cmd+Shift+P) → “Python: Select
Interpreter” and make sure the same Python version is selected
everywhere, then reinstall the packages from Step 4 using that
interpreter’s terminal. |
If you’re stuck after trying the table above, bring your laptop to the next workshop — setup help is part of what the early workshops are for — or post your exact error message on the Canvas discussion board.
This setup is required for the workshops and for the Lab Assessment, which is done in VS Code (not Google Colab or Jupyter in a browser).