Handy MATLAB utility to switch between conda environments from within MATLAB
- Grab this repo. Chuck it somewhere on your path.
- Determine where your base
condainstallation by opening a terminal and typingwhich conda. Make a note of that path. - Type
conda.initin your MATLAB terminal. It should prompt you for the path you got in step 2.
To view all your conda environments (i.e., the equivalent of conda env list)
conda.getenv()
% You'll see something like this:
asimov /Users/sg-s/anaconda3/envs/asimov
mctsne /Users/sg-s/anaconda3/envs/mctsne
*tensorflow /Users/sg-s/anaconda3/envs/tensorflow
root /Users/sg-s/anaconda3
and the * indicates the currently active environment
To switch between environments (i.e., source activate env)
conda.setenv('env_name')
It's that simple. Enjoy.