Skip to content

Instantly share code, notes, and snippets.

@lijunzh
Last active March 30, 2020 20:48
Show Gist options
  • Save lijunzh/869caa5b8e55c7e2144a2504382f8aae to your computer and use it in GitHub Desktop.
Save lijunzh/869caa5b8e55c7e2144a2504382f8aae to your computer and use it in GitHub Desktop.
Bash script that setup standard conda environment for scientific conputing from scratch.
#!/bin/bash
INSTALL_DIR=${HOME}/conda
INSTALL_SH='conda.sh'
# determin OS
OS=$(uname -s)
CONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-${OS/Darwin/MacOSX}-$(uname -m).sh"
# download installation file
wget ${CONDA_URL} -O ${INSTALL_SH}
# install via bash
bash ${INSTALL_SH} -b -p ${INSTALL_DIR}
# activate conda base env
source ${INSTALL_DIR}/bin/activate
conda init
# update conda env
conda update --yes conda
# clean install script
rm ${INSTALL_SH}
conda clean --all --yes
@lijunzh
Copy link
Author

lijunzh commented Mar 6, 2020

Script is updated to accomendate new Miniconda url and new conda API.

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