Python 2 installations at NSC


Directory list:

VersionDescription
2.7.12 Python 2.7.12
2.7.13 Python 2.7.13
2.7.3 Python 2.7.3
2.7.4 Python 2.7.4
2.7.6 Python 2.7.6

Level of support

Tier 3 NSC will not be able to help you much with this program, either because we lack the in-house experience, or because it is a test installation. In general, these types of installations are untested, and will not be updated unless you send a request to NSC.

Please see the page describing our software support categories for more information.
You can also contact support@nsc.liu.se for further information.

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.

How to run

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.

Using with mpi4py

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

while mpirun will most probably also work, the above is a safer option. Remember to change “python” to “python3” if needed.