Setup your machine
This page explains how to install Python and the Jupyter editor on your machine.
You don't need any installation if you only use Colab
Used Jupyter notebooks will be made available with suitable links
- Visit the download page of Python
- Download the version 3.8.10 of Python for your machine
- Install the downloaded package
- If requested, select 'Add Python to PATH'
- If requested, disable path length limit
- Test your Python installation
- Open a terminal (Unix, Mac OS) or command prompt (Windows - just search for cmd)
- Type
python3 --version
. You should get:Python 3.8.10
- Otherwise type
python --version
. You should get:Python 3.8.10
- NOTE: In the rest of this page we will refer as
python3
to eitherpython
orpython3
as used in these steps
- NOTE: In the rest of this page we will refer as
- Restart your machine
-
Open a terminal/command prompt
-
Install jupyter typing
python3 -m pip install jupyterlab
- [Optional] Update pip if a warning is provided typing
python3 -m pip install --upgrade pip
- [Optional] Update pip if a warning is provided typing
-
[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
- 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
- Create a new virtual environment:
python3 -m venv env_iproml_2021
- Then activate it:
- Linux/Mac:
source env_iproml_2021/bin/activate
- Windows:
env_iproml_2021\Scripts\activate
- Linux/Mac:
- Install ipykernel:
python3 -m pip install ipykernel
- Install a new kernel
python3 -m ipykernel install --user --name=env_iproml_2021
- Deactivate the virtual environment:
- Linux/Mac:
deactivate
- Windows:
env_iproml_2021\Scripts\deactivate.bat
- Linux/Mac:
- Open a terminal/command prompt and move to a directory where you want to store configurations for this course (not the code):
-
[Optional] Install additional useful jupyter-lab extension
- Install a spell-checker for Markdown cells
python3 -m pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
jupyter nbextension enable spellchecker/main
- Install a debugger (only for jupyter-lab 3 or superior)
python3 -m pip install xeus-python notebook
- Install a spell-checker for Markdown cells
At this point, you can start jupyter-lab in any directory of your choice, create a new notebook and select the kernel
- Open a terminal/command prompt
- Launch jupyter typing
jupyter-lab
- A web browser should open showing something like
- Click on the Python logo with name env_iproml_2021 (or on the one named Python 3)
- Next to '[ ]:' type
print('Hello, world!')
- Click on the Run icon (the gray triangle above the editor). You should get:
- Go to https://www.knime.com/downloads/download-knime
- Select the KNIME version for your computer:
- Mac
- Windows – 32 or 64 bit
- Linux
- Download archive and extract the file, or download installer package and run it
- Start KNIME Analytics Platform
- Use the shortcut created by the installer, or go to the installation directory and launch KNIME via the knime.exe
Note: The workspace is the folder/directory in which workflows (and potentially data files) are stored for the current KNIME session.
-
Install the KNIME Python Integration. In KNIME Analytics Platform, go to File → Install KNIME Extensions. The KNIME Python Integration can be found under KNIME & Extensions or by entering Python Integration into the search box. Restart KNIME if necessary.
-
Find working Python environment used for the Jupyter notebooks
- Launch jupyter
- Click on the Python logo with name env_iproml_2021 (or on the one named Python 3)
- Next to '[ ]:' type:
import sys
sys.executable
-
Configure Python environment
In KNIME go to"File→Preferences→KNIME→Python":
- select Python 3 by default
- select Manual as Python environment configuration
- set the path to Python 3 used for the Jupyter notebooks
IProML: Introduction to Programming and Machine Learning in Python
The right-sidebar can be used to navigate pages related to the course, e.g., to retrieve slides, code and assignments for our Lectures.