Skip to content

Instantly share code, notes, and snippets.

@branning
Last active February 20, 2018 15:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save branning/01c2a8a4dd5f39e6d3effab68d8d169a to your computer and use it in GitHub Desktop.
Save branning/01c2a8a4dd5f39e6d3effab68d8d169a to your computer and use it in GitHub Desktop.
Install miniconda3 64-bit
#!/bin/bash
#
# Install conda
# modified from https://github.com/blaze/odo/blob/master/.travis.yml
miniconda_home=$HOME/miniconda
case $OSTYPE in
linux*) OS='Linux';;
darwin*) OS='MacOSX';;
mysys*|cygwin) OS='Windows';;
esac
install_latest()
{
wget http://repo.continuum.io/miniconda/Miniconda3-latest-${OS}-x86_64.sh -O miniconda3.sh
bash miniconda3.sh -b -p ${miniconda_home}
rm miniconda3.sh
}
install_path()
{
# install miniconda to PATH
if ! grep -q miniconda $HOME/.profile
then
cat <<EOF >>$HOME/.profile
# add conda to path
if [ -d \$HOME/miniconda ]
then
PATH="\$PATH:${miniconda_home}/bin"
# set to 'no' if you don't like command prompt frobbing
conda config --set changeps1 yes
fi
EOF
fi
source $HOME/.profile
}
# if conda is not on the path, put it there
# if it's still not on the path, install it
if ! command -v conda
then
install_path
if ! command -v conda
then
install_latest
source $HOME/.profile
fi
fi
conda config --set always_yes yes
conda update conda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment