Handy MATLAB utility to switch between conda environments from within MATLAB
- Download this repo and add to path.
- Determine where your base
conda
installation by opening a terminal and typingwhich conda
. Make a note of that path. - Type
conda init
in your MATLAB terminal. It should prompt you for the path you got in step 2.
condalab
works exactly like conda
.
So if you want to list the environments you have, you can use
% yes, type this in your matlab prompt
conda env list
base /Users/srinivas/anaconda3
*umap /Users/srinivas/anaconda3/envs/umap
and the *
indicates the currently active environment.
To switch environments, use
% yes, type this in your matlab prompt
conda activate umap
To check that everything worked, you can run
conda.test
The python executable I am using is located at:
/Users/srinivas/anaconda3/envs/umap/bin/python
and you see that it is using the right environment.
It's that simple. Enjoy.
GPL v3