Introduction

On this page we'll see how to use Python on the tara
cluster. Before proceeding, make sure you've read the
How To Run tutorial first.
Python is a popular full-featured
scripting language. It can be used interactively or through scripting.

Loading the module

There are several versions of Python installed on tara. To enable the
most recent version, enter the following command

[araim1@tara-fe1 ~]$ module load python/2.7.2

This must be done before running your Python code, either interactively or
through the batch system. If you forget to load the module, your account will
probably default to using an older version.

Alternatively, you can load the module from within a shell script
(e.g. from your submission script) as follows

Notice that the first line is not the usual "#!/usr/bin/python", which points
to an older version of Python on tara. Instead, "#!/bin/env python" ensures
that the module-loaded version of Python is used when invoking the script without
the interpreter

We can launch it with a standard SLURM script. Again, we'll specify the "-l"
option to Bash and load the module from within the batch script. The script
will probably function correctly if you haven't made these additions, but
have entered the "module load python/2.7.2" command in your current shell session.
We suggest these modifications to your batch script regardless, as a best
practice.