Skip to content

Commit 7aa745a

Browse files
committed
Merge pull request #14 from jakirkham/include_miniconda3
Include Python 2 and Python 3
2 parents 6f70302 + 2710d86 commit 7aa745a

File tree

1 file changed

+39
-21
lines changed

1 file changed

+39
-21
lines changed

miniconda/install_miniconda.sh

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,42 @@ apt-get install -y libSM6 libXext6 libXrender1
1818
# Clean out apt-get.
1919
apt-get clean
2020

21-
# Download and configure conda.
22-
cd /usr/share/miniconda
23-
curl http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh > miniconda.sh
24-
bash miniconda.sh -b -p /opt/conda
25-
rm miniconda.sh
26-
export PATH="/opt/conda/bin:${PATH}"
27-
source activate root
28-
conda config --set show_channel_urls True
29-
30-
# Install basic conda dependencies.
31-
conda update -y --all
32-
conda install -y pycrypto
33-
conda install -y conda-build
34-
conda install -y anaconda-client
35-
conda install -y jinja2
36-
37-
# Install python bindings to DRMAA.
38-
conda install -y drmaa
39-
40-
# Clean out all unneeded intermediates.
41-
conda clean -yitps
21+
# Install everything for both environments.
22+
export OLD_PATH="${PATH}"
23+
for PYTHON_VERSION in 2 3;
24+
do
25+
export CONDA_PATH="/opt/conda${PYTHON_VERSION}"
26+
27+
# Download and install `conda`.
28+
cd /usr/share/miniconda
29+
curl "http://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION}-latest-Linux-x86_64.sh" > "miniconda${PYTHON_VERSION}.sh"
30+
bash "miniconda${PYTHON_VERSION}.sh" -b -p "${CONDA_PATH}"
31+
rm "miniconda${PYTHON_VERSION}.sh"
32+
33+
# Configure `conda` and add to the path
34+
export PATH="${CONDA_PATH}/bin:${OLD_PATH}"
35+
source activate root
36+
conda config --set show_channel_urls True
37+
38+
# Update and install basic conda dependencies.
39+
conda update -y --all
40+
conda install -y pycrypto
41+
conda install -y conda-build
42+
conda install -y anaconda-client
43+
conda install -y jinja2
44+
45+
# Install python bindings to DRMAA.
46+
conda install -y drmaa
47+
48+
# Clean out all unneeded intermediates.
49+
conda clean -yitps
50+
51+
# Provide links in standard path.
52+
ln -s "${CONDA_PATH}/bin/python" "/usr/local/bin/python${PYTHON_VERSION}"
53+
ln -s "${CONDA_PATH}/bin/pip" "/usr/local/bin/pip${PYTHON_VERSION}"
54+
ln -s "${CONDA_PATH}/bin/conda" "/usr/local/bin/conda${PYTHON_VERSION}"
55+
done
56+
57+
# Set the conda2 environment as the default.
58+
# This should be removed in the future.
59+
ln -s /opt/conda2 /opt/conda

0 commit comments

Comments
 (0)