Python Libraries

What versions of Python are available?

We have several different versions of the Python interpreter available: 3.6, 3.8, 3.9 and 3.10

Python v2.x is not supported.

Where are Python libraries installed?

Python libraries are sourced from system packages, python module bundles, from source code and from Anaconda. Each type of source has a different install location, as discussed in the next answer.

How do I use Python libraries?

For Python modules coming from system packages you need not make any changes to your environment paths. But to use any other form of Python libraries, you would need to add the install location to your environment paths.

Although possible, it is generally not recommended to mix Anaconda’s libraries with any of the bundles.

Refer to the tabs below for more information on how to use these Python modules.

Anaconda brings in a lot of open-source Python modules and it’s own Python interpreter. Popular modules like Jupyter Notebook, TensorFlow, CUDA, CuDNN, PyTorch, OpenCV etc are included in this install. The current version of Anaconda provides Python v3.10

To use Anaconda (with Python v3.10), run the following command:

module load python/anaconda

To use Python v3.9 via Anaconda, use the following command instead of above:

module load python/anaconda/py3.9-2022.08   

To use Python v3.8 via Anaconda, use the following command instead of above:

module load python/anaconda/py3.8-2021.11

Once this has been done, verify that you are using Anaconda’s Python interpreter by the command:

which python

This should return:

/usr/local/anaconda3/<version>/bin/python

To see if a module is installed, use the conda command. For instance, if you would like to check whether tensorflow is installed :

conda list tensorflow
# packages in environment at /usr/local/anaconda3/2023.03:
#
# Name                    Version                   Build  Channel
tensorflow                2.12.0                   pypi_0    pypi
tensorflow-estimator      2.12.0                   pypi_0    pypi
tensorflow-io-gcs-filesystem 0.33.0                   pypi_0    pypi 

Now you may use the modules provided by Anaconda.

This is a complete bundle of various Python libraries for Python 3.6

To use this, run the following command:

module load python/bundle-3.6

To see what libraries are available in this bundle, you may browse the directory:

ls -l /usr/local/python-env/py36/lib/python3.6/site-packages

The versions of packages in the bundle are frozen. If you need a specific version for a package, please contact us.

This is a complete bundle of various Python libraries for Python 3.8

To use this, run the following command:

module load python/bundle-3.8

To see what libraries are available in this bundle, you may browse the directory:

ls -l /usr/local/python-env/py38/lib/python3.8/site-packages

The versions of packages in the bundle are frozen. If you need a specific version for a package, please contact us.

This is a complete bundle of various Python libraries for Python 3.9

To use this, run the following command:

module load python/bundle-3.9

To see what libraries are available in this bundle, you may browse the directory:

ls -l /usr/local/python-env/py39/lib/python3.9/site-packages

The versions of packages in the bundle are frozen. If you need a specific version for a package, please contact us.

A Python library I need is not installed. What are my options?

You could install the module in your home directory, see this page for more information. Or contact us and we will help you out.