Installing Python (optional)

Installing Python (optional)#

https://www.python.org/static/community_logos/python-logo.png

This chapter provides instructions on how to install Python on your personal computer.

Installing Python on your device is optional. All class exercises can be completed using the university’s workstations. However, installing Python on your own device allows you to work on exercises at home and can be a valuable learning experience.

There are multiple ways to install Python on your computer. While most methods work, some are more practical than others. Unless you are experienced with Python installations (i.e., you have done this before), please follow these instructions carefully.

Install Miniconda#

We will use an installation option with a minimal footprint on your computer: Miniforge

Download the Windows installer amd double-click the .exe file to execute it.

Follow the prompts, taking note of the options to “Create start menu shortcuts” and “Add Miniforge3 to my PATH environment variable”. I’d recommend you to not add Miniforge3 to the PATH environment variable, as it can cause conflicts with other software (it is ticked off per default). Without Miniforge3 on the path, the most convenient way to use the installed software (such as commands conda and mamba) will be via the “Miniforge Prompt” installed to the start menu (see Testing your installation below).

Important! About the installation location

Choose a folder located in where there is enough space available, for example in your user directory (e.g. C:\Users\yourname\Miniforge3). Do not install in a folder with special characters in the name (e.g. french accents), as this can cause issues with conda.

For these platforms, no need to download the files yourself, but you need to run a script. See the instructions here.

Testing your installation#

To see if everything worked well, open a terminal prompt.

On Windows, open the miniforge prompt (from the Start menu, search for and open “miniforge prompt”):

miniforge prompt

The prompt you opened should display a line like this:

(base) C:\Windows\System32>

For these platforms, the terminal is available by default. You can open it by searching for “terminal” in the search bar.

Now you should have a terminal window open. In the terminal, type:

mamba list

You should see a long list of package names.

If you type:

python

A new python prompt should appear, with something like:

Python 3.12.7 | packaged by Anaconda, Inc. | (main, Oct  4 2024, 13:17:27) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

You can type exit() to get out of the python interpreter.

Learning checklist#