Minnesota Supercomputing Institute
3.10.10-gcc-8.2.0-sanagub
3.10.10-gcc-13.1.0-ucftoxt, 3.10.10-gcc-7.2.0-v45hj6j, 3.10.10-gcc-8.2.0-boc3bal, 3.10.10-gcc-8.2.0-sanagub, 3.12-rc/module.tcl, 3.10.9_anaconda2023.03_libmamba, 3.4, 3.5.2_anaconda4.1.1, 3.6.3_anaconda5.0.1, 3.7.1_anaconda, 3.7.4_anaconda2019.10, 3.8.3_anaconda2020.07_mamba, 3.9.3_anaconda2021.11_mamba, 3.2.3, 3.4, 3.6.3
Wednesday, March 6, 2024
Python is a high level programming language that aims to combine remarkable power with very clear syntax. Its success in these areas has led to strong adoption by the scientific community, resulting in numerous math, physics, chemistry, and biology libraries being contributed from the community of users.
MSI maintains installations of Python optimized for scientific and development use on all MSI computational resources. These include additional tools and libraries such as IPython, SciPy, NumPy, BioPython, Django, and many others. MSI supports the Enthought Python Distribution/Canopy and Continuum Analytics Anaconda Python as well as the PyPy alternative Python implementation.
To enable our default version of Python 2.7 (currently a version of the Enthought distribution), type
module load python
To enable our recommend version of Python 3 (currently a version of the Anaconda distribution), type
module load python3
Several other versions of Python are available, but the versions may be different on different platforms. To list all versions of Python available on the machine, type
module avail python
Assistance with Python programming is available by contacting help@msi.umn.edu.
The following information applies to all supported versions of Python. Additional information relevant to a particular environment can be found at the following links:
In the examples below we use module load python. They will also work if you select a specific environment version (python3/3.4) or implementation (python-epd, python-pypy). Loading a module for Python will make that Python environment your default for all Python-related commands.
To run Python interactively in a Linux environment run the commands:
module load python ipython
If you would like to run a Python script, myscript.py, use the following command:
module load python python myscript.py
Our recommended environments for Python 2.7 (module load python) and Python 3.4 (module load python3) include a wide variety of useful scientific, mathematical, and programming packages already installed. You can usually determine if a package is installed by attempting to import its module from Python:
module load python ipython > import somepackage
If this succeeds without printing an error, the package is installed and ready to use. Otherwise, in most cases we recommend that you use the provided tools to install a local copy of the package in your home directory.
The simplest way to accomplish this is to use pip to install from the Python Package Index. Once you have determined the PyPI name of the package you want, you can install or upgrade the package with the commands:
module load python pip install --user --upgrade packagename
For more complex installations you may want to create a Python virtual environment in your home directory. The commands to do so are not the same across all Python environments. Please see the software documentation page for the environment you are using for instructions.