For Anaconda I suggest you a much easier and proper solution;
just give a look at the nb_conda_kernels package.
It allows you to “manage your conda environment-based kernels inside the Jupyter Notebook”.
Is should be included since Anaconda version 4.1.0, otherwise simply use
conda install nb_conda
Now you should be able to manage all direcly from the Notebook interface.
Note that only environments that have a Jupyter kernel installed (in the case of Python, the ipykernel
package). Quote from the nb_conda_kernels
GitHub page:
Any other environments you wish to access in your notebooks must have an appropriate kernel package installed. For instance, to access a Python environment, it must have the ipykernel package; e.g.
conda install -n python_env ipykernel