Skip to content

Instantly share code, notes, and snippets.

@bryant1410
Last active October 7, 2019 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryant1410/d8689bdc8c8d82306b7897bce86f32dd to your computer and use it in GitHub Desktop.
Save bryant1410/d8689bdc8c8d82306b7897bce86f32dd to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
if [[ $# -eq 0 ]]; then
echo "Illegal number of arguments. Usage: ${0} env_name_or_prefix [args]..."
exit 2
fi
name=$1
shift
PATH=$HOME/miniconda3/condabin:$PATH # or like `module load python3.6-anaconda`
eval "$(conda shell.bash hook)"
conda activate "${name}"
python "$@"
#!/usr/bin/env bash
name=$(echo $0 | cut -d '-' -f 2)
$HOME/conda-python ${name} "$@" # or from another directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment