Python

Introduction

The HPC cluster provides different versions of Python through the Module System. The majority of Python installs are performed using the GNU toolchains, so it is preferable to load these prior to working with Python modules.

module purge
module load gcc openmpi

Python 3

Python version 3 modules are named like "python/version". For example, to list all version of Python 3 available:

module spider python

Output:

------------------------------------------------

  python:

------------------------------------------------

    Description:

      A powerful high-level programming language


     Versions:

        python/3.5.1

        python/3.6.6

        python/3.7.0

        python/3.8.6

You can then load the version you would like to use by specifying the name and version, e.g.:

module load python/3.6.6

Python 2

There is currently one version of Python 2 available, and it can be loaded as:

module load python2/2.7.13

Virtual Environments

Python 2 and 3 include for support for a powerful isolation technique know as a "virtual environment" that lets the user install packages in a self-contained instance of Python. You can read more about how to create and use these on our guide for Virtual Environments.

Numpy and Scipy

Two frequently utilized packages for Python are Numpy and Scipy. These are both installed in the system package repository for Python versions available through the module system. You can read more about them in our guide for Python - NumPy/SciPy.