PDAI Setup your machine - EMbeDS-education/ComputingDataAnalysisModeling20242025 GitHub Wiki

This page explains how to install Python and the JupyterLab editor on your machine. You have two options:

  1. install a standalone desktop application for JupyterLab that already includes a Python environment:
  2. manually install Python and Jupyterlab.

Do not install anything, use Google Colab (Option 0)

You don't need any installation if you only use Colab
Used Jupyter notebooks will be made available with suitable links

  • Colab

Install Visual Studio Code (Option 1)

We suggest this option

  • Support for debugger and further advanced features!
  1. Visit the download page of Visual Studio Code https://code.visualstudio.com/Download
  2. Download and install the right distribution
  3. Open Visual Studio Code,
    1. Click on Extensions (the for squares in the picture), write @recommended:languages (with no spaces before and after)
      • Install python and jupyter support
    2. Install both Python and Jupyter
    3. You should now be good to go

Install JupyterLab Desktop (Option 2)

  1. Visit the JupyterLab Desktop
  2. Download the version for your machine
  3. Install the downloaded package
  4. JupyterLab Desktop can be launched from the GUI of your operating system by clicking the application's icon, or by double clicking on a .ipynb file!

Install Python (Option 3.1)

  1. Visit the download page of Python
  2. Download the version 3.9.10 of Python for your machine
  3. Install the downloaded package
    1. If requested, select 'Add Python to PATH'
    2. If requested, disable path length limit
  4. Test your Python installation
    1. Open a terminal (Unix, Mac OS) or command prompt (Windows - just search for cmd)
    2. Type python3 --version. You should get: Python 3.9.10
    3. Otherwise type python --version. You should get: Python 3.9.10
      • NOTE: In the rest of this page we will refer as python3 to either python or python3 as used in these steps
    4. Restart your machine

Install JupyterLab (Option 3.2)

  1. Open a terminal/command prompt

  2. Install jupyter typing python3 -m pip install jupyterlab

    • [Optional] Update pip if a warning is provided typing python3 -m pip install --upgrade pip
  3. [Optional] It is convenient to install ipykernel and to add a new kernel for this course. This will help you maintaining a clean Python installation

    1. Open a terminal/command prompt and move to a directory where you want to store configurations for this course (not the code): cd the/directory/path
    2. Create a new virtual environment: python3 -m venv env_pdai_2024
    3. Then activate it:
      • Linux/Mac: source env_pdai_2024/bin/activate
      • Windows: env_pdai_2024\Scripts\activate
    4. Install ipykernel: python3 -m pip install ipykernel
    5. Install a new kernel python3 -m ipykernel install --user --name=env_pdai_2024
    6. Deactivate the virtual environment:
      • Linux/Mac: deactivate
      • Windows: env_pdai_2024\Scripts\deactivate.bat
  4. [Optional] Install additional useful jupyter-lab extension

    1. Install a spell-checker for Markdown cells
      • python3 -m pip install jupyter_contrib_nbextensions
      • pip install jupyterlab-spellchecker
      • jupyter contrib nbextension install --user
      • jupyter nbextension enable spellchecker/main
    2. Install a debugger (only for jupyter-lab 3 or superior)
      • python3 -m pip install xeus-python notebook

At this point, you can start jupyter-lab in any directory of your choice, create a new notebook and select the kernel

  • It might happen that the spell-checker does not get correctly installed.
  • Please click on the 'puzzle' icon shown below, enable extensions if asked, and search and the jupyter_lab_spellchecker plugin shown in the picture

Install the spell-checker

Test your system

  1. Open a terminal/command prompt
  2. Launch jupyter typing jupyter-lab
  3. A web browser should open showing something like A screenshot of jupyter
  4. Click on the Python logo with name env_pdai_2024 (or on the one named Python 3)
  5. Next to '[ ]:' type print('Hello, world!') Hello, world!
  6. Click on the Run icon (the gray triangle above the editor). You should get: Hello, world!

PDAI2-PM

Install Disco

  • If you have a @santannapisa.it email, you can get an Academic Alliance for free
  • If not, the demo version is enough for the sake of this course.

Install PM4Py

  • It is a python library. In our notebooks you will find the instructions to install it
⚠️ **GitHub.com Fallback** ⚠️