🐍 PYTHON HANDS-ON · THURSDAY 2 JULY

Get your computer ready for the GORDIAN score workshop

Installing Python, creating a virtual environment, and installing the workshop libraries

Hands-on: GORDIAN score — Thursday 2 July, 13:45–15:15

Coffee break 15:15–15:30 · continued 15:30–16:45

Aleksandra Suwalska & Karolina Kuliś — Department of Data Science and Engineering, Silesian University of Technology, Gliwice

💬 Support & questions: Slack only

All communication about this workshop goes through our Slack channel. If you're in the EEBG 2026 workspace, open it here:

Open the Slack channel →

Test your setup in advance. If something fails, post on Slack before the session. We cannot resolve every issue live during the workshop.

⏰ You can install everything during the session — but doing it in advance helps

There's enough time in the workshop to install Python and complete the tasks, so this is optional. That said, if you set things up beforehand you'll arrive ready and spend the full session on the actual analysis instead of installation. These instructions are written so that even if this is your first time using Python, you can follow them step by step.

📋 What you'll need

🐍Python 3 installed on your computer — 3.10, 3.11 or 3.12 recommended (see the note under “What gets installed” below)
📁The workshop materials downloaded into one folder (must contain requirements.txt)
⌨️A terminal: Windows → Command Prompt (Wiersz polecenia, recommended) or PowerShell · macOS / Linux → Terminal
📦A virtual environment with the required libraries installed (the steps below create this)

📁 WORKSHOP MATERIALS

Workshop files (including requirements.txt) are shared in this Google Drive folder. Additional files will appear here as the instructor uploads them, so check the folder again before the session. Put everything into one workshop folder on your computer.

📥 Open the materials folder →

Shared via Google Drive · files will be available here for the session.

📦 What gets installed

Running pip install -r requirements.txt installs the Python libraries this workshop uses:

numpy pandas scipy scikit-learn statsmodels matplotlib seaborn umap-learn gseapy jupyterlab ipywidgets

⚠️ Why we recommend Python 3.10–3.12: two of these libraries — umap-learn (which builds on numba/llvmlite) and gseapy — are sometimes slow to ship prebuilt packages for the very newest Python release. On a brand-new version (e.g. 3.13) their install can fail or try to compile from source. A 3.10–3.12 Python avoids this entirely. If you already have a newer Python and the install fails on one of these, that's the likely cause — post on Slack and we'll help.
🐍 Already using conda? Alternative setup click to expand

If you already have conda or Miniforge, you can use a conda environment instead of the venv steps below. One of the packages, gseapy, comes from the bioconda channel, so configure the channels first:

conda config --add channels conda-forge
conda config --add channels bioconda

conda create -n gordian python=3.11
conda activate gordian

conda install numpy pandas matplotlib seaborn bioconda::gseapy \
  statsmodels umap-learn scikit-learn scipy jupyterlab ipywidgets

Then start JupyterLab from the activated environment:

jupyter lab
If the solver stalls or conflicts, run conda config --set channel_priority flexible and repeat the conda install. If you don't use conda already, skip this box and follow the standard steps below.

💡 First, two words you'll see a lot

Terminal / Command Prompt — a text window where you type commands instead of clicking. You'll use it to move into the workshop folder, create the environment, and install packages.

Virtual environment — a separate Python workspace just for this workshop. It lets us install the workshop's libraries without touching the Python already on your computer, so nothing conflicts with your other projects.

Pick your operating system and follow that section:

If Python is already installed, you can skip straight to Step 3 (create the virtual environment).

🪟 Windows MOST PARTICIPANTS · click to collapse

Step 1 · Check whether Python is already installed

Open the Start menu and type Wiersz polecenia (or Command Prompt), or PowerShell, and open it. In the window that appears, type:

py --version

If that shows nothing useful, try:

python --version

✓ See something like Python 3.11.x? → skip to Step 3. Nothing found? → do Step 2.

Step 2 · Install Python

  1. Go to python.org/downloads/windows and download the latest stable Python 3 installer.
  2. Run the installer.
  3. Very important: on the first screen, tick “Add python.exe to PATH” at the bottom before clicking Install. This is what lets the terminal find Python.
  4. Click Install Now and wait for it to finish.
  5. Close and reopen the Command Prompt / PowerShell window (it only picks up the new PATH in a fresh window).
  6. Check again: python --version
⚠️ If Python still isn't found after installing, you almost certainly missed the “Add python.exe to PATH” checkbox. Re-run the installer, choose Modify, and make sure PATH is enabled — or simply uninstall and reinstall, ticking the box this time.

Step 3 · Move into the workshop folder

Put all workshop materials in one folder — for example a folder called GORDIAN_hands_on on your Desktop (any name is fine). Then move into it with cd (“change directory” — it points the terminal at that folder):

cd Desktop
cd GORDIAN_hands_on

Confirm the workshop files are here by listing the folder contents:

dir
⚠️ If you don't see requirements.txt in the list, you're in the wrong folder. Note: if your Desktop is synced to OneDrive, the first step may need to be cd OneDrive\Desktop instead of cd Desktop.

Step 4 · Create the virtual environment

This makes a .venv folder inside your project that holds a private Python just for this workshop. You only do this once.

py -m venv .venv

Step 5 · Activate the environment

.venv\Scripts\activate

You should now see (.venv) at the start of the line — that means the terminal is now using the workshop's Python.

📢 You need to activate the environment every time you open a new terminal window for this project.
⚠️ PowerShell only: if activation fails with a message about scripts being disabled, run this once, then try activating again:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
(Command Prompt / Wiersz polecenia doesn't have this issue — that's why it's the recommended option.)

Step 6 · Upgrade pip and install the libraries

pip installs Python libraries. Upgrade it first (fewer install errors), then install everything listed in requirements.txt:

python -m pip install --upgrade pip
python -m pip install -r requirements.txt

✓ This can take a few minutes. If it finishes with no error at the end, you're installed and ready.

Step 7 · Start JupyterLab

See the How to run and use JupyterLab section below (with screenshots), or if you already know it, launch it and start on the tasks.

↩️ Coming back later (optional)

Next time, you don't recreate .venv or reinstall anything — just open a terminal, go to the folder, and activate:

cd Desktop\GORDIAN_hands_on
.venv\Scripts\activate

To leave the environment when you're done: deactivate

🍎 macOS click to expand

Step 1 · Open Terminal and check for Python

Open Terminal: press Cmd + Space, type Terminal, press Enter. Then type:

python3 --version

✓ See Python 3.11.x (or similar)? → skip to Step 3. Nothing? → do Step 2.

Step 2 · Install Python

The simplest option: download the latest stable Python 3 for macOS from python.org/downloads/macos and run the installer. Then close Terminal and open it again, and check:

python3 --version

Advanced users can install with Homebrew instead, but that's not required for the workshop.

Step 3 · Move into the workshop folder

Put the materials in one folder (e.g. GORDIAN_hands_on on your Desktop), then move into it with cd:

cd ~/Desktop/GORDIAN_hands_on

List the contents to confirm the files are there:

ls
⚠️ No requirements.txt in the list? You're in the wrong folder. Tip: type cd (with a space) then drag the folder from Finder into the Terminal window to paste its exact path.

Step 4 · Create the virtual environment

Creates a .venv folder with a private Python for this workshop. Do this once.

python3 -m venv .venv

Step 5 · Activate the environment

source .venv/bin/activate

You should see (.venv) at the start of the line.

📢 Activate the environment every time you open a new Terminal tab/window for this project.

Step 6 · Upgrade pip and install the libraries

With (.venv) active, run:

python -m pip install --upgrade pip
python -m pip install -r requirements.txt

✓ A few minutes is normal. No error at the end = success.

Step 7 · Start JupyterLab

See the How to run and use JupyterLab section below (with screenshots), or launch it yourself and begin the tasks.

↩️ Coming back later (optional)

cd ~/Desktop/GORDIAN_hands_on
source .venv/bin/activate

Leave the environment when done: deactivate · No need to recreate .venv or reinstall packages.

🐧 Linux click to expand

Step 1 · Open Terminal and check for Python

python3 --version

✓ See Python 3.11.x (or similar)? → skip to Step 3. Nothing? → do Step 2.

Step 2 · Install Python

On Ubuntu, Debian or Linux Mint:

sudo apt update
sudo apt install python3 python3-pip python3-venv

You may be asked for your system password — that's normal, and it stays invisible as you type (no dots appear). This installs Python, pip, and the venv tool. Then check again:

python3 --version

On other distributions, use your system's package manager to install Python 3, pip, and venv.

Step 3 · Move into the workshop folder

Put the materials in one folder (e.g. GORDIAN_hands_on on your Desktop), then:

cd ~/Desktop/GORDIAN_hands_on

List the contents:

ls
⚠️ No requirements.txt? You're in the wrong folder.

Step 4 · Create the virtual environment

python3 -m venv .venv

Do this once — it creates the .venv workspace for this project.

Step 5 · Activate the environment

source .venv/bin/activate

Look for (.venv) at the start of the line.

📢 Activate every time you open a new Terminal for this project.

Step 6 · Upgrade pip and install the libraries

python -m pip install --upgrade pip
python -m pip install -r requirements.txt

✓ A few minutes is normal. No error at the end = success.

Step 7 · Start JupyterLab

See the How to run and use JupyterLab section below (with screenshots), or launch it and begin the tasks.

↩️ Coming back later (optional)

cd ~/Desktop/GORDIAN_hands_on
source .venv/bin/activate

Leave with deactivate · No need to recreate .venv or reinstall.

🪐 How to run and use JupyterLab click to collapse

Start JupyterLab

Start JupyterLab inside the command window of your system (Command Prompt / Terminal / PowerShell) with:

jupyter lab

JupyterLab should open automatically in your web browser. If it does not open automatically, the command window will show a link — copy that link and paste it into your browser.

What is JupyterLab?

JupyterLab is a working environment for Python. It opens in a web browser, but it runs on your computer. We will use it to work with notebook files, which usually end with .ipynb

A notebook is divided into cells. A cell can contain code, text, results, tables or plots. This is useful during a workshop because we can run the code step by step and immediately see the results.

JupyterLab interface overview

Basic work in JupyterLab

Open a notebook

In JupyterLab, use the file browser on the left side and open the workshop notebook (a file ending in .ipynb) that the instructor shares.

A notebook is divided into smaller blocks called cells. A cell is one separate part of the notebook. You can run cells one by one. This is useful because we can build the analysis step by step, check intermediate results and correct mistakes without running the whole file every time.

There are two cell types that we will use most often.

A code cell contains Python code. For example:

print("Hello from Python")

When you run a code cell, Python executes the code and shows the result below the cell. Code cells are used for loading data, calculations, analysis, plots and model training.

A Markdown cell contains text, notes, explanations, headings or instructions. Markdown cells are not Python code. They are used to make the notebook easier to read.

JupyterLab cells and toolbar, annotated

Legend to the image above

  • → purple arrow — Markdown cell: double-click to edit an existing one; to create a new one, click on the empty cell (green arrow) and change the cell type from “Code” to “Markdown” (green box).
  • → red arrow — Code cell: this is where you write and execute the code. The output appears under the cell (blue arrow).
  • → blue arrow — the output of the code cell. The result appears after you press Shift + Enter.
  • → green arrow — an empty Code/Markdown cell. The cell behaviour can be changed in the drop-down menu (green box).
  • → brown arrow — your working directory and all files inside it. Each notebook you create appears in the folder.
  • orange circle — the + sign: opens the launcher where you can create a new notebook or Python file (also open a terminal or other file types if you have the extensions installed).
  • pink box — the toolbar: manipulate cells and the notebook here. From the left: save the notebook, insert a new cell below, cut the selected cell, copy and paste the cell, run the selected cell, interrupt the kernel (stop the cell), restart the kernel, and run all cells after restarting. Other options exist but aren't needed for this workshop — feel free to explore them.

Run a cell

Click inside a cell and press:

Shift + Enter

This runs the selected cell and moves to the next one (it creates an empty cell if there is none). You can also use the Run button at the top of the notebook (the pink panel in the image above).

📢 Run cells from top to bottom, in order. This matters because later cells often use data, variables or functions created in earlier cells. If you skip earlier cells, later code may not work.

Edit and rerun a cell

Click inside a code cell, change the code, and run it again with Shift + Enter — the output below the cell will update. To update a Markdown cell, double-click on it.

Add a new cell

Click the + button in the notebook toolbar (pink box in the image above).

Save your notebook

Use Ctrl + S. Save your work regularly. To rename the notebook, right-click it and select “Rename Notebook…”.

Stop code that runs too long

If a cell runs for too long, click the square Stop button in the notebook toolbar.

Restart Python inside the notebook

The Python process running the notebook is called the kernel. If something behaves strangely, restart it via the Kernel > Restart Kernel menu, then run the notebook again from the beginning.

How to close JupyterLab

  1. Save your notebook.
  2. Close the browser tab.
  3. Return to the command window.
  4. Press Ctrl + C.
  5. Confirm if the command window asks whether to stop JupyterLab.
🔧 Common pitfalls click to expand
SymptomFix
Windows: python not recognised even after installingThe “Add python.exe to PATH” box was missed. Reinstall and tick it, then open a fresh terminal. Meanwhile py often still works.
PowerShell: activation blocked (“running scripts is disabled”)Run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned once, or just use Command Prompt (Wiersz polecenia) instead.
requirements.txt not found by pipYou're not in the workshop folder. Run dir (Windows) / ls (macOS/Linux) and cd into the right folder first.
Windows: cd Desktop says the path doesn't existYour Desktop is on OneDrive. Try cd OneDrive\Desktop instead.
No (.venv) appears after activatingActivation didn't run. Recheck the exact command for your OS (Windows uses .venv\Scripts\activate, macOS/Linux use source .venv/bin/activate).
Install runs for a whileNormal — some libraries are large. Wait for the prompt to return with no error.

✅ Ready-to-go checklist

☐ python --version (or python3 --version) shows Python 3
☐ Workshop folder contains requirements.txt
☐ .venv created and activated — you see (.venv) in the terminal
☐ pip install -r requirements.txt finished with no error
☐ Laptop + power cable packed for Thursday

🤝 Didn't manage to finish? That's fine.

Setup is optional — there's time to install during the workshop, and we'll help anyone who gets stuck at the start. If you do get it working in advance, great: you'll have the full session for the GORDIAN score tasks.

GORDIAN score hands-on · EEBG 2026 · Python virtual environment + JupyterLab