Anaconda python on hail in 2020

Overview of changes

Anaconda (conda) has grown from its linux-centric collection of shell scripts into a multi-platform package manager. source activate is out. conda commands are the new way. Please switch to the new way by running though these instructions.

Initialization and configuration of conda

First we want to have the conda command available when we log in:

/home/conda/bin/conda init bash

This adds a few lines to your ~/.bashrc file. It also checks for the existence of and creates if necessary the file ~/.condarc and the folder ~/.conda to hold your local envs. The next time you log in, the conda base env will be loaded. If you’d rather not have the base env loaded every time you log in, you can modify this with:

conda config --set auto_activate_base False

The conda command will still be available for use, but no envs will be active. As part of our multi-user installation, please run the following to prevent package cache collisions.

conda config --append pkgs_dirs "/home/${USER}/.conda/pkgs"

Many of you will be using the conda-forge channel. It may be easier if you set that priority now, before you start building. Mixing of channels can send you into dependency hell.

conda config --prepend channels conda-forge

Activation of envs

After logging out and back in. Everything should be ready for you to conda all your old envs. To activate an env,

conda activate my_env

if no env is supplied, it will activate the base environment.

Creation

env creation is pretty much the same. Here we create and activate an env named my_env.

conda create --name my_env conda activate my_env

add some packages

conda install xarray jupyter matplotlib pynio

When things go wrong

You can always start over. To nuke an env you’ve destroyed:

conda env remove --name my_env

You can also remove and reinstall packages in the active env, for example:

conda remove matplotlib conda install --channel conda-forge matplotlib

The user guide is here https://docs.conda.io/projects/conda/en/latest/user-guide/index.html and as always, feel free to email Kelly Hirai with questions kgh03@fsu.edu.


This document was translated from LATEX by HEVEA.