How do I delete/refresh available kernels for IPyt

2019-01-21 16:17发布

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?

6条回答
叛逆
2楼-- · 2019-01-21 16:46

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

查看更多
走好不送
3楼-- · 2019-01-21 16:47

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.

查看更多
爱情/是我丢掉的垃圾
4楼-- · 2019-01-21 16:54

Running:

jupyter --paths

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

查看更多
爷、活的狠高调
5楼-- · 2019-01-21 16:55

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楼-- · 2019-01-21 16:57

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

查看更多
爷的心禁止访问
7楼-- · 2019-01-21 17:08

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
查看更多
登录 后发表回答