Knowledge Base

Python on the Academic Computing Cluster

A range of Python environments are available on the Reading Academic Computing Cluster (RACC), all of which can be accessed with the ‘module‘ command. The most widely used and maintained distribution is Enthought Canopy, but we also have Anaconda Python available. Note that the Python environment packaged with the operating system is also installed and this is the environment you get when you type ‘python’ with no python module loaded.

Python 3 is fundamentally different from, and not compatible with Python 2. Python 2.7 is still widely used. On the RACC, all the modules running Python 2.7 are grouped under ‘python2.7/…’. The modules loading Python 3 environments are grouped under ‘python3/…’. Check with the command ‘module avail python’ or ‘module avail python3’ for the full list of options on the RACC.

Our default versions of Anaconda and Canopy have been installed with all packages included which were available from the distributor at the time of installation. It is not possible to install additional packages in those shared environments.

If you require a custom environment, with different versions of packages or additional packages, you will need to a create a personal copy of the user environment in either Anaconda or Canopy as follows.

 

User Environments in Anaconda Python

Before you begin, please note that at least 3GB of free space are required in your home directory if you want to set up a user environment in Anaconda Python. It is not possible to set this up in a different location. Home directories can easily fill up, causing various computing issues, so please be mindful of this when you choose to install your own Python environment.

First you’ll need to load the anaconda module that is installed under python3/anaconda.

Note that you can specify the Python version you want at the time of creating your environment. The instructions are the same whether you want Python 2.7 or 3.5, just specify your preferred version accordingly in the ‘conda create’ command below.

You can now create your own environment (called ‘myenv’ in our example here) with the following command:

Substitute ‘X.X’ with the Python version that you want to install in your environment in the command above, e.g. 2.7 or 3.5. You will only need to run the above command once. It will take a while setting up your environment and install the initial packages. Follow the screen prompts to proceed with the installation. Once finished, you can call your own environment from the terminal shell with:

Note that the python3/anaconda module has to be loaded in order for this to work. When your environment is successfully loaded, the terminal prompt is preceded by ‘(myenv)’, e.g.:

Now you can install your own packages in your environment with:

If the package you require is not found via the ‘conda’ command, you can also try using ‘pip’:

If both of the above options can’t find what you’re looking for, it’s still possible to install your desired package by downloading it directly from the developer and following their installation instructions whilst the your environment is activated.

 

User Installation in Python Canopy 2.1

Before you begin, please note that at least 2GB of free space are required in your home directory for the Canopy Python user installation. It is not possible to install this in a different location. Home directories can easily fill up, causing various computing issues, so please be mindful of this when you choose to install your own Python environment.

The following command installs your personal Python environment from the Canopy 2.1.8 distribution. You will only need to run this once and afterwards your personal environment will be automatically called when you load the ‘canopy2-userenv’ module.

The installation will take quite a while and end with displaying the Canopy GUI. From here, you can install additional packages in the ‘Package Manager’. In order to use this feature, you’ll need to register with Enthought.

From now on your own Python user environment can be simply loaded with:

If you don’t want to use the Canopy package manager to install packages, you can also use the native ‘edm’ command instead.

If the package you require is not found via the ‘edm’ command, you can also try using ‘pip’:

If both of the above options can’t find what you’re looking for, it’s still possible to install your desired package by downloading it directly from the developer and following their installation instructions whilst the canopy2-userenv module is loaded.