Python 2

Description

Python (2) is a dynamic object-oriented programming language that can be used for many kinds of software development. In itself Python is mostly used for system administration and file handling. However, with add-on packages like numpy and scipy, Python has proved very useful for scientific programming as well. For more information about Python, see https://www.python.org/ and for numpy/scipy, see https://scipy.org/

The default version of Python (2) installed on the login/compute nodes is 2.7.5. That is the one you get if you type python at command line.

Home Page

https://www.python.org/

Documentation

https://docs.python.org/2/

License

Open source, details on terms and conditions are available at https://docs.python.org/2/license.html

Usage

Use

module avail Python/2

to see which versions of Python 2 are available. Use

module load Python/version

to get access to Python 2.

Installed packages

Several packages have been pre-installed on Colossus.  Do

pip list

in your shell to see what is available.  If you don't find what you need there, it is usually easy to install your own packages with pip.

Installing packages

pip normally requires access to Internet, which is not accessible from TSD/Colossus. We have therefore installed a full, local mirror to PyPi inside TSD (https://pypi.tsd.usit.no/simple). Hence, all packages that are available from PyPi should be installable also inside Colossus (with a 3-week security delay).

We encourage you to install the packages you need yourself.  That way you can upgrade packages whenever you need. The packages will be installed to $HOME/.local, so if the package includes executables you may want to add $HOME/.local/bin to your $PATH. The packages may be installed as follows:

module load Python/2.7.18-GCCcore-9.3.0 
pip install --user <package name>

Windows

On Windows hosts you'll have to point to the mirror explicitly:

pip install --user --index-url=https://pypi.tsd.usit.no/simple <package name>

Please note that commands like pip search do not work on this mirror, so to search for PyPi packages you will have to do it outside TSD.

Did you find what you were looking for?
Published June 21, 2021 10:35 AM