Use Python on IU research supercomputers

On this page:


Overview

Python is a free, open source, interpreted programming language available for most operating systems. It is object-oriented, interactive, and easily extensible. Python is often used as a scripting language, but it is fully functional as a general purpose programming language. For more, see Python.

Python is available on Indiana University's research supercomputers.

If you do not already have an account on one of IU's research supercomputers, see Research system accounts (all campuses) for information about eligibility and links to instructions for creating (or requesting) an account.

Set up your user environment

To use Python on the IU research supercomputers, you must add it to your user environment by loading one of the available Python modules:

  • To add the default Python version, on the command line, enter:
    module load python
  • To add a non-default version of Python:
    1. Check which versions are available; on the command line, enter:
      module avail python
    2. Load the preferred version; on the command line, enter (replace version.branch.release with the appropriate version number):
      module load python/version.branch.release

      For example, to add Python 3.10.5 to your Quartz user environment, on the command line, enter:

      module load python/3.10.5

If Python is among the currently loaded modules, but you want to use another version, use the following command to swap the currently loaded module with the preferred version (replace current_version and new_version with the appropriate version numbers):

module switch python/current_version python/new_version

You can save your customized user environment so that it loads every time you start a new session; for instructions, see Use modules to manage your software environment on IU research supercomputers.

Invoke the interpreter and check packages

Once the desired Python version is added to your user environment, you can invoke the Python interpreter from the command prompt; enter the following command, depending on the version:

  • Python 2.7.x: python
  • Python 3.x: python3
Note:
If you enter python but don't have a Python 2.7.x module loaded, the "native" Python version that's installed with the operating system (at /usr/bin/python) will launch. The "native" version is not supported on any of the IU research supercomputers. To use Python on an IU research supercomputer, you must have one of the available Python modules loaded and use the version-appropriate command to invoke the interpreter.

Many supplemental packages are installed for use with the Python builds available on the IU research supercomputers. To check which packages are available for use with the currently loaded Python module, on the command line, enter:

pip list

If you have a unique need for a third-party Python package that is not already installed, you can install it for personal use in your home directory. Alternatively, if you know several researchers are interested in using a particular Python package that is not already installed, you can request to have it installed as a system-wide site package. For more, see Install Python packages on the research supercomputers at IU.

Get help

If you have a question or need help using Python on an IU research supercomputer, contact the UITS Research Applications and Deep Learning team.

For general questions about research computing at IU, contact UITS Research Technologies.

This is document bflv in the Knowledge Base.
Last modified on 2023-11-20 13:59:32.