Skip to content

Instantly share code, notes, and snippets.

@kameshsampath
Created May 19, 2024 08:25
Show Gist options
  • Save kameshsampath/7f13ef7ac8aeff8ac8102201aad3430c to your computer and use it in GitHub Desktop.
Save kameshsampath/7f13ef7ac8aeff8ac8102201aad3430c to your computer and use it in GitHub Desktop.
Autoload conda environment using direnv
# assumes miniconda is installed on user home
# direnv can be installed using brew install direnv or other OS specific methods
use_conda(){
local conda_setup="$("$HOME/miniconda3/bin/conda" 'shell.zsh' 'hook' 2> /dev/null)"
eval "$conda_setup"
conda activate <name of your conda environment to load>
}
strict_env
use conda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment