Last active
February 3, 2024 04:55
-
-
Save jph00/3707260aeba1a9c03e469f5ecf524b34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
### | |
# NB: You probably don't want this gist any more. | |
# Instead, use this version from `fastsetup`: | |
# https://github.com/fastai/fastsetup/blob/master/setup-conda.sh | |
### | |
set -e | |
cd | |
case "$OSTYPE" in | |
darwin*) DOWNLOAD=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh; RC_FILE=.bash_profile ;; | |
linux*) DOWNLOAD=https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh; RC_FILE=.bashrc ;; | |
*) echo "unknown: $OSTYPE" ;; | |
esac | |
case "$SHELL" in | |
/bin/zsh*) SHELL_NAME=zsh; RC_FILE=.zshrc ;; | |
/bin/bash*) SHELL_NAME=bash ;; | |
/usr/local/bin/fish*) SHELL_NAME=fish ;; | |
*) echo "unknown: $SHELL" ;; | |
esac | |
cat << EOF > .condarc | |
channels: | |
- fastai | |
- pytorch | |
- defaults | |
channel_priority: strict | |
EOF | |
wget $DOWNLOAD | |
bash Miniconda3-latest*.sh -b | |
~/miniconda3/bin/conda init $SHELL_NAME | |
rm Miniconda3-latest*.sh | |
perl -n -e 'print if />>> conda/../<<< conda/' $RCFILE > .condainit | |
perl -ni -e 'print unless />>> conda/../<<< conda/' $RCFILE | |
echo source ~/.condainit >> $RCFILE | |
source ~/.condainit |
mamba
is no longer needed -- I've now updated the gist to reflect that. I've also added a link to a somewhat more official version that's in fastsetup
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Leaving this here just in case: I finally added the channel manually:
conda config --append channels conda-forge
, after which I was able to runconda install -y mamba