Apart from the Python version (as of 2012–12–11, version 2.6.6) that is bundled with RHEL/CentOS, we also provide additional Python versions.
These are usually based on a more recent Python version, and includes Python modules that are requested by many NSC users.
If you want to build your own Python environment with additional modules that are not part of any of the NSC-provided Python versions, you can often use virtualenv
As of September 2016, we have also installed the Anaconda Python distribution 4.1.1.
We keep Python 3 installations separate.
Load the Python module corresponding to the version you want to use, e.g
module load python/2.7.12
This will add the Python commands to your search path.
For running python in parallel using
mpi4py it does not work at the moment with
mpprun. Instead, load the compiler module containing the mpi which the python module was built with. For example:
module load python/2.7.12 module load buildenv-intel/2016-3
and e.g. run using (this example for 10 mpi-ranks):
mpiexec.hydra -n 10 -bootstrap slurm python your_script.py
mpirun will most probably also work, the above is a safer option.
Remember to change “python” to “python3” if needed.