Installation instructions

In this course you will use Python and a range of packages for data wrangling, statistical analysis and visualization. To ensure that you can run the exercises, follow the installation instructions in this manual carefully.

Step 1: Install Miniconda

To ensure that everybody has the correct version on Python and the necessary packages installed to run the exercises without issues, it is required to install a package manager that manages the endless combination of package versions, dependencies, operating systems and hardware configurations. For this, you will be using Anaconda3, or preferably its lightweight version Miniconda3, which works on all common operating systems.

  • If you have Anaconda3 or Miniconda3 already installed and have worked with it before, feel free to use that installation. Note that it is highly advisable to update your conda executable in that case. To do so, go to Anaconda Prompt or your terminal and update it using:
conda activate base
conda update conda
  • If you do not have Miniconda3 installed, please install it using the correct version for your operating system (Windows, MacOS or Linux) by following the instructions at https://docs.anaconda.com/miniconda/.

    • Microsoft Windows
      Select the only installer available https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe
    • For MacOS
      Make sure to download the correct version for the processor architecture of your computer. To determine whether a Mac is running an Intel Processor or Apple ARM M1 processor, click on the Apple Menu in the top left and select “About this Mac”. From the ‘About this Mac’ screen, on the ‘Overview’ tab, look for a line that indicates either ‘Chip’ or ‘Processor’. Download the appropriate pkg installer and install.
    • Linux
      You’ll probably manage :-)


    If you do not manage to install Miniconda properly, feel free to ask for help.

After installation, start using Miniconda3 by:

  • Microsoft Windows
    Open start menu and type “Anaconda” and open the start menu item Anaconda Prompt (Miniconda3)

  • MacOS
    Click the Launchpad icon in the Dock, type Terminal in the search field, then click Terminal. In the terminal run the command conda activate

  • Linux
    Open terminal and run the command conda activate

Step 2: Setting up the virtual environment

In Miniconda3, it is advisable to never install packages into your base environment. Instead, it is best to create a new so-called virtual environment for each separate project that requires a specific set of packages and/or tools.

Virtual environments are isolated spaces that allow you to manage project-specific dependencies without affecting the global Python installation. Each virtual environment contains its own Python executable and libraries, ensuring that changes made within one environment cannot impact others. This is good, because things are bound to go messy at a certain point. No problem, just create a new environment!

For more information on using conda please refer to the user guide.

To set up the necessary virtual conda environment for this course copy the entire following command and paste it into Anaconda Prompt (Windows) or the terminal (MacOS/Linux). Note that pasting in the terminal is usually performed using a right mouse button click.

conda create -n data2 -c conda-forge python=3.12 ipython jupyter spyder=5.5.6 numpy pandas matplotlib scipy statsmodels seaborn geopandas geodatasets scikit-bio scikit-learn

Searching for packages, matching package versions and installation may take a while, please be patient. When conda asks for installation confirmation, follow the instructions in the terminal.

After creating the environment, you can always make modifications to the installed packages, e.g. adding/removing them and changing package versions (see user guide for instructions).

Step 3: Starting the Spyder IDE

In the course you will be using Spyder, which is a so-called Integrated development environment (IDE) for Python. The IDE will provide you with a place to edit scripts, a Python console and plots. To start it:

  • Microsoft Windows
    You can find the Spyder installation of your virtual environment in the start menu. Search for Spyder in the start menu and start “Spyder (data2)“. If it is not present in the Start Menu, open Anaconda Prompt (Miniconda3), run the command conda activate data2, and subsequently run the command start /b spyder and keep the Anaconda Prompt window open.
  • MacOS / Linux
    Open the terminal, run the command conda activate data2, and subsequently run the command spyder & and keep the terminal window open.

Step 4: Downloading all necessary input data

You also need some input data for this course, all relevant data can be downloaded from Surfdrive.

Makes sure you put all data in a Data folder that is in the main directory where your store all the information for this course. We recommend you to make a new folder for every practical and run your scripts from there and have a dedicated Data folder that contains all relevant input data.