Python on the CLSP grid

From CLSP Wiki
Jump to: navigation, search

Python

Python (version 2.7.13) is installed on the CLSP grid at

/usr/bin/python

Python3 (version 3.5.3) is installed on the CLSP grid at

/usr/bin/python3

Local installs

If some Python package that you need is not installed on the grid, it is often possible to install it by a command such as

pip install --user <package-name>


Conda/Anaconda

It is possible to use a virtual environment for python using anaconda/conda.

To install anaconda (to your local directory), follow the instructions. The basic usage is available at here.

Making a virtual environment

A virtual environment are useful when installing packages specifically for a given project.

 virtualenv -p `which python2` ~/my-virtual-env-name
 source ~/my-virtual-env-name/bin/activate
 pip install --upgrade pip
 pip install -r my-project-requirements.txt

The `source ~/my-virtual-env-name/bin/activate` loads this particular virtual environment. And should be included in any qsub scripts which utilizes these packages.