Python is an interpretive programming language.

Category:  Programming Language

 Availability: Open access for all users

Usage Notes

A "stock" installation of Python is in the default path and is distributed with the operating system.

Show the version with the command: python -v

CCR also supports an alternative to the "stock" installation via the Anaconda distribution. It is available as a module for academic users

Show the software versions:  module avail python

Loading the module will set the path and any necessary variables: module load python/anaconda

Anaconda Python comes installed with numerous packages including NumPY and SciPY. Additional packages that are certified to work correctly within the Anaconda Python distribution are available from the anaconda repository. Other packages may also be available, but are not guaranteed to work. Individual users are responsible for installation and maintenance of packages not included in the CCR anaconda installation. Instructions for installing packages in "user space" are given below:

Installing a Certified Package from the Anaconda Repository
Use "conda install" for certified packages:
       module load python/anaconda
conda install -p /path/to/your/pkg/install/dir name_of_package

 Note: /path/to/your/pkg/install/dir could be either under /projects or your user home directory (/home/<username>). More information on "conda install" is located here

Installing Any Other Python Packages
Use pip to install in your home directory:
    module load python/anaconda
    pip install --user

Use pip to install in a projects directory:
     module load python/anaconda
pip install --install-option="--prefix=/projects/my/pkg/dir" \
        --install-option="--install-lib=/projects/my/pkg/dir/lib" \

    More information on pip install is available here

Activating Support for Python 3
Anaconda supports Python 3 but it must be explicitly activated. For example:
    module load python/anaconda
    source activate /util/academic/python/anaconda/envs/py35

To revert to Python 2, use the deactivate command:

    source deactivate

Using Python in an HPC Environment

Python supports a wide range of strategies for taking advantage of HPC resources. The Using-Python-2017.pdf file below provides an overview of what's available on the UB CCR cluster.

The Basics of Python (adapted from BCH 519)
CCR's Andrew Bruno has lectured on using Python for Bioinformatics applications. A condensed version of his interactive Python tutorial is given in the Intro_to_Python.pdf file below.