Skip to content

Instantly share code, notes, and snippets.

@esc
Last active Oct 8, 2018
Embed
What would you like to do?
Anconda activation and deactivation functions for ZSH
# Functions to activate/deactivate Continuum Analytics Anaconda Python distribution
# by manipulating the $PATH.
export ANACONDA_PATH="$HOME/anaconda/bin"
function have_anaconda(){
[[ -n $path[(r)$ANACONDA_PATH] ]]
}
function anaconda_on(){
if have_anaconda ; then
print "Anaconda already activated"
else
export PATH=$ANACONDA_PATH:$PATH
fi
}
function anaconda_off(){
if ! have_anaconda ; then
print "Anaconda not found on PATH"
else
path[$path[(i)$ANACONDA_PATH]]=()
fi
}
@hagai-lvi
Copy link

hagai-lvi commented Feb 20, 2016

Thanks for the great script!
if someone is having trouble in ubuntu, anaconda 2.7 is installed in $HOME/anaconda2/.
So in ubuntu you need export ANACONDA_PATH="$HOME/anaconda2/bin"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment