forked from pymc-devs/pymc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_miniconda.sh
More file actions
executable file
·48 lines (38 loc) · 1.41 KB
/
install_miniconda.sh
File metadata and controls
executable file
·48 lines (38 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
set -e # fail on first error
if conda --version > /dev/null 2>&1; then
echo "conda appears to already be installed"
exit 0
fi
PYTHON_VERSION=${PYTHON_VERSION:-3.6} # if no python specified, use 3.6
if [ ${PYTHON_VERSION} == "2.7" ]; then
INSTALL_FOLDER="$HOME/miniconda2"
else
INSTALL_FOLDER="$HOME/miniconda3"
fi
if [ ! -d $INSTALL_FOLDER ] || [ ! -e $INSTALL_FOLDER/bin/conda ]; then
if [ "$(uname)" == "Darwin" ]; then
URL_OS="MacOSX"
elif [ "$(expr substr "$(uname -s)" 1 5)" == "Linux" ]; then
URL_OS="Linux"
elif [ "$(expr substr "$(uname -s)" 1 10)" == "MINGW32_NT" ]; then
URL_OS="Windows"
fi
echo "Downloading miniconda for $URL_OS"
DOWNLOAD_PATH="miniconda.sh"
if [ ${PYTHON_VERSION} == "2.7" ]; then
wget http://repo.continuum.io/miniconda/Miniconda-latest-$URL_OS-x86_64.sh -O ${DOWNLOAD_PATH};
else
wget http://repo.continuum.io/miniconda/Miniconda3-latest-$URL_OS-x86_64.sh -O ${DOWNLOAD_PATH};
fi
echo "Installing miniconda for python-$PYTHON_VERSION to $INSTALL_FOLDER"
# install miniconda to home folder
bash ${DOWNLOAD_PATH} -b -f -p $INSTALL_FOLDER
# tidy up
rm ${DOWNLOAD_PATH}
else
echo "Miniconda already installed at ${INSTALL_FOLDER}. Updating, adding to path and exiting"
fi
export PATH="$INSTALL_FOLDER/bin:$PATH"
echo "Adding $INSTALL_FOLDER to PATH. Consider adding it in your .rc file as well."
conda update -q -y conda