MSSL Basic User Note #1:


Anaconda, a user installable Python on Linux

RDW 17-Jul-2019 V1.7

This document is http://www.mssl.ucl.ac.uk/www_computing/buns/user_python.html

0. Why Anaconda?

There are two ways to install software on a Linux system. Root, the system administrator account that can do anything and write anywhere on local disks, provides a huge range of general and specialised utilities including Python which in the main are specially packaged so that they work well with other similarly provided utilities which together make up what is essentially the operating system.

This is of course a very general description but more or less is what the MSSL computer group provides as its Red Hat Linux distribution. It is a collection of Red Hat supplied utilities and quite a few third party utilities with many local MSSL customisations. Red Hat supplied utilities are made compatible with each other by Red Hat. This means that not all Red Hat utilities are the most recent versions available but often improvements are incorporated into software that looks on the face of it to be older. The third party software from various vendors may also not be fully up-to-date because it too relies on the Red Hat supplied software for various functionality which might not be in the current Red Hat release.

There are about 2,500 individual packages in the MSSL linux distribution, many of which provide several utilities and they are all, or rather should be, mutually compatible. In the Linux world packages have 'dependencies' and all MSSL distribution dependencies are met or 'satisfied'.

Which brings us to Python but Python is by no means unique.

Red Hat provides a variety of Python versions, which as documents age, it makes little sense to list here but it is safe to they probably won't be the most up-to-date available from the internet.

So why don't we simply download the latest version, compile it as necessary and write it to the operating system?

Because it would break the operating system. Other parts of the operating system would expect to find something and instead would find what we had installed. It's those dependencies again. They make sure everything works but they also often prevent the most recent software being easily installed.

The solution of course is to write this software somewhere else, out of harms way so the operating system can continue. If it is going to be written somewhere else it can be written anywhere which means it can be written by ordinary users to ordinary user disks. At MSSL we have software disks maintained by the various research groups and of course we have individual user disks. Where in this space it makes sense to install 'user installable' software is a matter for the user and the group concerned.

What follows are instructions to install Anaconda. To avoid confusion when talking to the computing group it is as well to understand that Anaconda is an unfortunate name because Anaconda is the Red Hat environment that installs operating systems as well as a completely different unrelated package that installs Python.

1. Anaconda download

At the time of writing https://www.anaconda.com/distribution/ is the URL to download Anaconda but take care the default is for Mac, so click the Linux tab and download the Linux version you need. At this writing versions 2.7 and 3.7 are available.

This will download a self extracting shell script. At this writing I downloaded the file Anaconda3-2019.03-Linux-x86_64.sh.

It is large, almost a Gigabyte, so choose carefully where you save it so that you don't go over quota on your /home disk.

2. Anaconda permissions

The downloaded file will only have read & write access and it needs to be executable so do this:

chmod u+x file

Replace 'file' with the name of your Anaconda self extracting shell script.

3. Anaconda installation

Run the self extracting shell script by prepending dot slash and pressing return:

./file

Replace 'file' with the name of your Anaconda self extracting shell script.

Follow the installation instructions, you will need to accept the licence terms and conditions.

Choose where you install carefully. Certainly don't install it in your home directory (which is probably the default offered!) and probably not in your /disk/user1 directory. Consider if this will be usefully installed as group software in a group accessible area.

Allow the installer to initialize Anaconda. This adds some configuration to your login script .bashrc in your home directory.

You'll need to run Anaconda in the BASH shell. If this is not your default shell, type "bash".

4. Using Anaconda

There is a user guide https://docs.anaconda.com/anaconda/ and a getting started guide https://docs.anaconda.com/anaconda/user-guide/getting-started/

5. Feedback

This document will get you through the installation but we are not experts on the use of Anaconda. If there are aspects of the installation or use of Anaconda which you feel would be of general interest to other users in this document please let us know.