问题
I am trying to figure out where are my anaconda kernels in my mac, since applications report different things.
If I run:
jupyter kernelspec list
I get:
Available kernels: python2
/Users/user/anaconda/share/jupyter/kernels/python2
However, when I open Jupiter notebook, I can see and use:
[I 07:47:21.394 NotebookApp] [nb_conda_kernels] enabled, 4 kernels found
Here are some screenshots:
How can I remove all of those envs and leave only conda root? Thanks
回答1:
You are using nb_conda_kernels package, which dynamically adds ipython kernels from other conda environments to Jupyter. Kernel specs for those kernels are not installed in the environment with Jupyter, that's why you don't see them with jupyter kernelspec list.
I can guess you run the command from the base (root) environment, thus the listed kernel should correspond to the Python [conda root] and Python [default] options in the menu.
Two other kernels are located in the 'anaconda' environment. If you activate it before running jupyter kernelspec list you will see the kernels' location:
source activate anaconda
jupyter kernelspec list
If you don't want to dynamically add kernels from other conda environments to Jupyter, remove the 'nb_conda_kernels' package from the environment where Jupyter is installed.
来源:https://stackoverflow.com/questions/50134013/locating-and-removing-hidden-kernels-in-jupyter-notebook