How do I delete/refresh available kernels for IPython/Jupyter notebook v4.0?

大兔子大兔子 提交于 2019-11-27 00:27:22

问题


I've recently stopped using macports so the kernel.json files I had for various IPython kernels are out of date. I have renamed ~/.ipython and removed ~/.jupyter but kernels launched are failing to start with file not found errors.

More tellingly, when I run jupyter-kernelspec list it still lists all the old kernels I had set up. Where is it getting this information from and what do I need to do to refresh/remove its cache?


回答1:


After a brute force search, Jupyter stores kernel info for OS X in /Users/${USER}/Library/Jupyter/kernels. This list got copied across from my .ipython/kernels list hence renaming it made no difference.

Removing /Users/${USER}/Library/Jupyter/kernels fixes the issue.

This is the reference I was looking for: http://jupyter-client.readthedocs.org/en/latest/kernels.html#kernelspecs




回答2:


This is an issue in Linux also if anyone else runs into it. Check the contents of: ~/.local/share/jupyter/kernels/




回答3:


Running:

jupyter --paths

will list all of the possible locations for everything it uses to run: kernels, extensions, pidfiles, etc.




回答4:


adding to jbcoe's answer, if you're using macOS, the two locations where you should expect kernels to be installed are

/Users/${USER}/Library/Jupyter/kernels

and

/usr/local/share/jupyter/kernels



回答5:


You may run jupyter kernelspec list in terminal or !jupyter kernelspec list in a notebook cell to see a list of available kernels and the locations.




回答6:


To complete the list, in Windows (at least Win 7) it is:

System-level: C:\ProgramData\jupyter\kernels

User-level: C:\Users\[username]\AppData\Roaming\jupyter\kernels

There is a folder per env(ironment) under the kernels folder. kernel.json within each subfolder is editable to change display name(s), or other parameters.



来源:https://stackoverflow.com/questions/31976367/how-do-i-delete-refresh-available-kernels-for-ipython-jupyter-notebook-v4-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!