Skip to content

Setup your machine

dlicari edited this page Jul 15, 2021 · 6 revisions

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

  • Colab

Install Python

  1. Visit the download page of Python
  2. Download the version 3.8.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.8.10
    3. Otherwise type python --version. You should get: Python 3.8.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

  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_iproml_2021
    3. Then activate it:
      • Linux/Mac: source env_iproml_2021/bin/activate
      • Windows: env_iproml_2021\Scripts\activate
    4. Install ipykernel: python3 -m pip install ipykernel
    5. Install a new kernel python3 -m ipykernel install --user --name=env_iproml_2021
    6. Deactivate the virtual environment:
      • Linux/Mac: deactivate
      • Windows: env_iproml_2021\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
      • 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

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_iproml_2021 (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!

Install KNIME Analytics Platform

  1. Go to https://www.knime.com/downloads/download-knime
  2. Select the KNIME version for your computer:
    • Mac
    • Windows – 32 or 64 bit
    • Linux
  3. Download archive and extract the file, or download installer package and run it
  4. 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.

Configuring KNIME

  1. 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.

  2. 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

Find Python

  1. 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

Set Python