Setup
Please complete the setup at least a day in advance of the workshop. If you run into issues, contact the workshop organizers by email so you’re ready to begin on time. The setup steps include:
- Set up the workshop folder
- Install Python 3.11.9
- Install
uvand set up the virtual environment
0. Set up a terminal or Git Bash if on Windows
To run the commands referenced in this setup, we recommend using:
- Terminal (Mac, Linux)
- Git Bash (Windows). Download and install from here: git-scm.com/install/windows. Git Bash provides a shell environment that closely resembles the terminal.
1. Set up the workshop folder
Create a folder on your desktop called ML_workshop for storing the workshop data and environment.
Open a terminal or Git Bash (Windows) to run the following commands. If you prefer, you can also create the folder manually on your Desktop.
# change directory to Desktop. Remember that "~" is a shortcut for the "home" directory (user-specific directory where Desktop, Downloads, Documents, etc. are typically stored)
cd ~/Desktop
# make new folder called "ML_workshop"
mkdir ML_workshop
# change directory to ML_workshop
cd ML_workshop
# print working/current directory to check work
pwd
2. Install Python 3.11.9
We recommend using Python 3.11.9 to ensure consistency across participants.
Download the appropriate installer from the official 3.11.9 downloads page. Follow your OS-specific installation steps. When prompted, select “Add python.exe to PATH”.
3. Install uv and set up the environment
uv is a modern, fast Python package and environment manager. It’s significantly faster than pip and simplifies reproducible setup.
Step-by-step instructions:
A. Install uv
pip install uv
B. Create a requirements.txt file in the ML_workshop folder:
touch requirements.txt # create blank file (while still in the ML_workshop folder)
Use your preferred text editor to add the following contents into ML_workshop/requirements.txt. Make sure to save the file with your edits.
numpy
pandas
matplotlib
opencv-python
scikit-learn
jupyterlab
seaborn
C. Set up the virtual environment:
pwd # check to make sure you're still in the ML_workshop folder. If not, use the `cd` command to change directories.
Create the virtual environment using python 3.11.9.
uv venv --python=3.11.9
This creates a folder named
.venv/in yourML_workshopdirectory.
Inside this folder, you’ll find many subfolders and files—that’s expected! Here’s what they do:
bin/(orScripts/on Windows): contains the Python interpreter and executable scriptslib/: stores all installed Python packages (and their dependencies)pyvenv.cfg: tracks Python version and configurationinclude/: headers used to build native extensionsThese components form an isolated environment, keeping your installed packages separate from your global Python setup.
D. Activate environment
Some installation environments may require a preliminary activation step before we install our requirements.
Run one of the OS-specific commands below just to be safe.
# Mac/Linux
source .venv/bin/activate
# Git Bash on Windows
source .venv/Scripts/activate
# Windows CMD (not recommended)
.venv\Scripts\activate.bat
E. Install requirements.txt
Install the libraries specified in requirements.txt. Our uv library makes this step fairly quick to run!
uv pip install -r requirements.txt
F. Add the environment to Jupyter Lab:
Run one of the OS-specific commands below. This allows us to select our new environment from Jupyter without having to activate it beforehand.
# Mac/Linux
.venv/bin/python -m ipykernel install --user --name=.venv --display-name "ML_workshop"
# Git Bash on Windows
.venv/Scripts/python.exe -m ipykernel install --user --name=.venv --display-name "ML_workshop"
# Windows CMD (not recommended)
.venv\Scripts\python.exe -m ipykernel install --user --name=.venv --display-name "ML_workshop"
G. Launch Jupyter Lab:
jupyter lab
When Jupyter opens, select the ML_workshop kernel from the dropdown to start a new notebook.
Paste this block of code into a Juypter Lab cell to verify that the installed libraries can successfully be imported.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import cv2
import seaborn as sns
from sklearn import datasets, model_selection, metrics
So long as you don’t get an error message here, you’re all set for the workshop!