Skip to main content
Print

Anaconda – INTRO

Anaconda Environments

Anaconda is a popular data science and programming platform that supports both Python and R codes.

Anaconda is primarily used to manage the installation of python or R packages in user defined environments. These environments allow a user to tailor the packages available in order to maximize performance. Anaconda also provides limited dependency installation, simplifying most programs installation procedures.

Anaconda can be loaded by any user on the ARC cluster by running:

module load anaconda

Anaconda/2.0 and Anaconda/3.0 are available on ARCC1 and ARCC2

Below are some common commands for creating, maintaining, and transferring Anaconda environments. Additionally, you may download this cheat sheet for reference.

Creating Environments

Once anaconda is loaded as a module Anaconda commands can be passed to the terminal.

To create a new environment:

  1.  
conda create --name TestEnvironment python=3.5

 

 

 

 

You can access anaconda on the ARCC by using the command: module load anaconda/3.0 or module load anaconda/2.0 , for the relevant python version. 

If you wish to create a custom environment, you can clone the base environment.  

conda create –clone base –name myclonedenv 

or create a new environment from scratch using

conda create -n py3 python=3 

Note that these environments will be made in your home directory and can be run from there through your batch scripts

A specific conda environment can be loaded using

Source activate myclonedenv 

Once you activate your local environment you can use pip to install packages (be sure to add the –user flag). 

to unload custom environment, and go back to the base system, use 

conda deactivate 

List of other common commands

 list the number of packages installed in conda environment: 

conda list -n py3 

Conda lets you install various packages containing programs which are not naturally installed on your HPC home directory, for example opencv. You can search for packages available via Conda like so: 

conda search opencv 

List the packages already installed in one of your Conda environments like so: 

conda list -n (environment name) 

Remove a particular package from a particular environment like so: 

conda remove –name (environment name) opencv 

Remove an entire Conda environment like so: 

conda remove –name (environment name) –all 

To verify the environment has been removed, list all remaining environments like so: 

conda info –envs 

Adding Python Modules to the current environment: 

conda install (package name) 

The packages are then copied in your $HOME/.conda directory, where you have written permissions. 

If you are not familiar with the clone command and switching between environments the following cheat sheet will be useful: https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf 

Table of Contents