Skip to content

PDAI Setup your machine

Andrea Vandin edited this page Oct 22, 2026 · 1 revision

This page explains how to install Python and an editor for 'jupyter notebooks'

  • Where a notebook is a collection of code and presentation material

You have two options:

  1. Do not install anything, and use Google colab (the google doc for python) [DEPRECATED]
  2. Install the open source free and standalone desktop application by Microsoft: Visual Studio Code [SUGGESTED]

We remark that we discourage the use of Google colab. However, we mention it as it could be convenient in case of initial configuration problems.

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

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 - SUGGESTED)

  1. Visit the download page of Python, and install a recent one (we suggest 3.14)
  2. Visit the download page of Visual Studio Code https://code.visualstudio.com/Download
  3. Download and install the right distribution
  4. 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
      • These are extensions (plugins) of Visual Studio to handle python
    3. You should now be good to go
    4. You may also want to install
      • GitHub Copilot
      • GitHub Copilot chat
      • This will make your editor integrated with Microsoft Copilot to
    5. If you are a chatgpt user, you may also want to install Codex
      • It is like the copilot above, but more powerful and based on chatgpt

Note for IT staff helping configuring to complex/remote configurations:

  • During the course, we will install additional libraries using pip, and we will create virtual environments
  • In previous editions, there have been problems with these features when 'connecting' the visual studio client of students with remote servers. For the sake of this course, we recommend standard installations on laptops

Test your system

  1. Open Visual Studio Code,
  2. In the top menu, click on File -> Open Folder
    • Pick (or create) a folder that will contain all files for the current project (do not use desktop or other 'special' folders)
    • You should see something like this A screenshot of VSC with workspace configured
      • Note that, on the left, it can be read the name of the picked folder (in this example, test_ws)
      • Also note that the screenshot has a message 'Restricted mode'. Click on Manage and then Trust
  3. Click on New File, and select Jupyter Notebook. This will create a new file .ipynb
    • A screenshot of VSC
    • In the dark gray cell (a Code cell), write print('Hello, World!').
      • This is a python instruction. In the following points, we will execute it.
  4. Create a virtual environment (more info found at the bottom of this page - in brief, a copy of the python installation will be done in the current folder):
    • On the top-right of the notebook, click on Select Kernel -> Python Environments -> Create Python Environment -> venv.
    • Then pick the python installation to use A screenshot of VSC with venv
  5. In the cell containing print('Hello, World!'), click on the play triangle.
    • As shown in the screenshot below, the python command will be executed printing Hello, World after the cell
    • Hello world

On Virtual Environments - no need to do anything now, reference material for class

In class, we will see how to create virtual environments. This will involve installing ipykernel and to add a new kernel for this course. This will help you maintaining a clean Python installation.

  • First of all, open Visual Studio Code, and do open folder. This is going to be a folder containing python/jupyter files
    • You can repeat this procedure for any folder you like
    • I recommend using a different folder per different project, following this procedure.
    • Click on Select Kernel in the top right of Visual Studio Code. Pick Select Another Kernel, Python Environments, Create Python Environment, Venv ....
    • Now pick the suggested Python installation.

This will have the effect of installing a new virtual environment .venv in the folder. This is nothing more than a copy of the main python installation contained in your computer. Any python library or setting will be added to this folder, without altering the original python installation. This also has the benefit of having different python installations/configurations per project, guaranteeing that old projects will keep working also in the future. Now you can select it by clicking again in Select Another Kernel, Select a Python Environment, and pick .venv

Clone this wiki locally