Last active
February 20, 2021 17:58
-
-
Save jojonki/808575aac293b0538ae4b108aefbb028 to your computer and use it in GitHub Desktop.
direnv for anaconda witch automatically switches anaconda environments.
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
activate_conda(){ | |
eval "$(conda shell.zsh hook)" | |
conda activate $1 | |
} |
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
export THIS_CONDA_ENV=your_conda_env_name | |
activate_conda $THIS_CONDA_ENV |
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
eval "$(direnv hook zsh)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nicely done! So simple compared to many other solutions out there. Thank you.