Anaconda Python in Randall-supported departments

Anaconda is now being installed as the default Python environment for both Mac and Linux computers (as of July 2017). The sections below include information and instructions for using Anaconda and the pre-made environments.

Common Conda Commands

The details in this section apply to both Mac and Linux computers.

Refer to the table of commands below for common tasks:

 Note
If you use the tcsh shell, it's recommended to switch to bash (Bourne-again shell) to run "conda activate".
Action Command
Initialize conda to allow you to run the following commands. You may have to use the full-path of conda the first time (/usr/local/anaconda/bin/conda or /usr/local/anaconda/condabin/conda). conda init
Prevent conda from automatically activating the base environment on login. conda config --set auto_activate_base false
Get a list of environments. The active environment is shown with * and the environment name appears in the left column. conda info --envs
Activate an environment to use it. Replace environment-name with the environment you want to activate. conda activate environment-name
Deactivate the current environment and return to the Root environment. conda deactivate
List packages installed in the active environment. conda list
Create a new environment in the default environment location (/usr/local/anaconda/envs). conda create -n environment_name
Create a new environment your home directory (~/). conda create --prefix ~/environment_name
Create a new environment in the default environment location and specify packages to install immediately. Separate packages with spaces. conda create -n environment_name python=version packages_to_install
Create a new environment your home directory (~/) and specify packages to install immediately. Separate packages with spaces. conda create --prefix ~/environment_name python=version packages_to_install
Install packages in the active environment. Separate packages with spaces. conda install packages_to_install

For a more comprehensive list of commands, please refer to the Conda cheat sheet or the Conda documentation.

Default Mac and Linux Environments

The following table shows what environments are typically installed by default for the departments listed in each "Departments" section. Names and versions evolve with time; to find out what environments exist on your system, run either conda info --envs or conda-env list.

Permissions are configured such that users are allowed to create their own environments within the default environment storage location (/usr/local/anaconda/envs) as well as in their home directories or any other location where they have write access.

Environment Example Location Python Version Departments
base or root (default) /usr/local/anaconda 2.7 or 3.7 Astronomy, Complex Systems, Physics, Statistics
python3 or py37 /usr/local/anaconda/envs/python3 3.7 Astronomy, Complex Systems, Physics, Statistics
iraf27 /usr/local/anaconda/envs/iraf27 2.7 Astronomy

Additional notes

Starting IRAF in the Anaconda Environment

Details

Article ID: 1651
Created
Wed 5/27/20 8:36 AM
Modified
Thu 10/1/20 10:28 AM