Anaconda Python

Overview

We offer Python 2.7 and 3.6 through the Anaconda environment manager. The benefit of using the Anaconda environment is that it is built with data science in mind: popular Python modules are already included in the environment, module versions are maintained by Anaconda for compatibility, and researchers can install additional modules to their home directory at any time. You can also create your own Python environments using Conda.

You can read about Anaconda and Conda at https://docs.continuum.io/anaconda/#anaconda-navigator-or-conda.

Anaconda Terminology

  • Using the "Shell" opens a new command-line environment (CLI) where the selected version of Anaconda (2 or 3) becomes the default Python environment. For example, if Anaconda3 is selected, running "python" invokes Python 3.6, and using "pip" installs modules for Python 3.6.
  • The "Navigator" is a desktop graphical user interface (GUI) that allows you to launch applications and easily manage conda packages, environments and channels without using command-line commands.

Running Anaconda

Note: The Anaconda GUI and CLI are available only on RCE exec nodes, and cannot be run on the login node.

There are several ways of invoking Anaconda:

  1. Launch an RCE Powered Shell
  2. Run "anaconda3-shell"
  3. You will get a bash shell configured so that when you run "python" it executes Anaconda Python 3.6 with the Anaconda libraries.

-or-

  1. Submit a batch job with Executable and Arguments as follows:
    - Executable = /usr/local/bin/python3
    - Arguments = script.py
  2. Have your script executed by Anaconda Python 3.6 with the Anaconda libraries.

-or-

Some combination of the above, like opening an RCE Powered Shell, and running a python script as:

python3 ~/script.py

The Anaconda 2 versions are:

  • anaconda2-shell
  • python2

Tip: Using Anaconda via SSH

  1. Log in to a RCE desktop session
  2. Select Applications > RCE Powered Applications > Anaconda Shell
    1. Enter your desired CPU and RAM
  3. Get the Condor job ID
    1. The job ID is listed in the top left-hand side of the window toolbar
      -or-
    2. Select Applications > System Tools > Terminal
      1. Run condor_q <username>
  4. Close your RCE desktop session (e.g. close your browser)
  5. SSH into the RCE from your local computer
    1. Execute condor_ssh_to_job <job_id>
    2. You should be within your chosen Anaconda environment