Set up
Colab takes two minutes and needs no install. JupyterLab on your laptop takes about 15 minutes, and uses all your cores.
Colab runs in your browser, so there’s nothing to install. Its free tier gives you 2 cores. JupyterLab on your laptop uses your own cores, often 8 or more. Both run the same notebook. Not sure? Start with Colab (part A). You can switch later.
A. Google Colab: nothing to install
- Open the learner notebook in Colab. The filled notebook has every answer.
- Sign in with your Google account.
- Click Copy to Drive in the toolbar. Work in the new tab, titled Copy of parallelization-with-python.ipynb.
- Click the first code cell under Setup, and press Shift-EnterShift-Enter. Run the next cell the same way.
It works when the first cell prints downloaded fire.py and downloaded lanes.py, and the second prints your Python version and start method: fork.
A “not authored by Google” warning means you’re in the original tab. Switch to your copy.
B. JupyterLab on your laptop
You already have uv and a dss-python folder with JupyterLab. Open a terminal, run cd dss-python, and skip to step 6.
1. Open a terminal
A terminal is a window where you type commands instead of clicking.
Press Cmd-SpaceCmd-Space, type Terminal, and press EnterEnter.
Press the WinWin key, type PowerShell, and press EnterEnter. Your prompt starts with PS C:\.
2. Install uv
uv is one small tool that installs Python and the packages you need. It needs no admin rights. Copy the line for your computer, paste it into the terminal, and press EnterEnter.
curl -LsSf https://astral.sh/uv/install.sh | shpowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"3. Check it worked
Close the terminal and open a new one, so it can find uv. Then run:
uv --versionYou should see a version number.
4. Make your project folder
uv init --python 3.13 --vcs none --no-package dss-parallel
cd dss-parallelThe folder is made in your home folder. --python 3.13 matches the Python that Colab uses, so the notebook behaves the same in both places.
5. Add JupyterLab, matplotlib and psutil
uv add jupyterlab matplotlib psutilThis is the slow step. It’s done when your prompt comes back. Download the notebook (step 6) while you wait.
6. Download the notebook
- Download the learner notebook: blank code to write with us. This is the one you need.
- Download the filled notebook: every answer, to check your work.
Your browser saves them in your Downloads folder.
Run this inside your project folder. The notebook lands right there, so you can skip dragging it in (step 7).
curl -LO https://raw.githubusercontent.com/NCSU-Libraries/parallelization-with-python/main/notebooks/parallelization-with-python.ipynbType curl.exe, with the .exe. Plain curl in PowerShell is a different tool.
curl.exe -LO https://raw.githubusercontent.com/NCSU-Libraries/parallelization-with-python/main/notebooks/parallelization-with-python.ipynb7. Start JupyterLab and run the Setup cells
Once step 5 is finished, run this in your project folder:
uv run jupyter labYour browser opens JupyterLab. Leave the terminal open. It’s running JupyterLab.
- Drag the notebook from your Downloads folder onto JupyterLab’s file list in the left sidebar. Or click the Upload button (↑) above the file list, and choose the file.
- Double-click the notebook to open it.
- Click the first code cell under Setup, and press Shift-EnterShift-Enter. Run the next cell the same way.
It works when the first cell prints downloaded fire.py and downloaded lanes.py (it needs the internet this once), and the second prints your Python version and start method: spawn on a Mac or Windows.
8. Stop, and start again later
Save your work with . To stop JupyterLab, go back to the terminal and press Ctrl-CCtrl-C twice. Next time, open a terminal and run:
cd dss-parallel
uv run jupyter labAlready use conda?
Use these commands instead of steps 2 to 5, in Terminal on a Mac, or in Anaconda Prompt or Miniforge Prompt on Windows. Then continue with step 6, and skip the uv run jupyter lab command: the last line starts JupyterLab.
conda create -y -n dss-parallel -c conda-forge --override-channels python=3.13 jupyterlab matplotlib psutil
conda activate dss-parallel
mkdir dss-parallel
cd dss-parallel
jupyter labThe first command is one long line. Use the copy button.
If something goes wrong
| What you see | What to do |
|---|---|
uv: command not found |
Open a new terminal. Still missing on a Mac? Run source $HOME/.local/bin/env. |
| “running scripts is disabled” (Windows) | Use the exact command in step 2, with -ExecutionPolicy ByPass. |
| The browser didn’t open | Copy the http://localhost:… link from the terminal and paste it into your browser. |
ModuleNotFoundError: No module named 'fire' |
Run the first Setup cell. It downloads fire.py and lanes.py next to the notebook. |
HTTPError or URLError in the first cell |
The download was blocked. Save fire.py and lanes.py into the notebook’s folder. |
Can't get attribute 'work' on <module '__main__'> |
Your worker function is defined in a cell. Put it in a .py file, as the template does with %%writefile. |
| A cell runs forever | Stop it (■), then restart: Kernel → Restart Kernel in JupyterLab, Runtime → Restart session in Colab. Run the cells again from the top. |
| Chromebook or tablet | Use Colab (part A). |
uv changes often. If a screen looks different, the official install page wins. Help with your own setup: go.ncsu.edu/getdatahelp.