Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 664
jbcoe Avatar asked Aug 12 '15 22:08

jbcoe


People also ask

How do you refresh a kernel jupyter?

Once you have your kernel working in a terminal, test your kernel from a Jupyter Notebook. To load an updated list of kernels, scroll down in the “Kernel” menu and select “Refresh kernel list”. Your kernel should show up with the given display_name !

How do I delete a Jupyter Notebook environment?

To deactivate the virtual environment, you can run deactivate . To delete the virtual environment you just need to remove the folder with the virtual environment (e.g. rm -r myenv ).

How do I quit IPython kernel?

To shut down a kernel, go to the associated notebook and click on menu File -> Close and Halt. Alternatively, the Notebook Dashboard has a tab named Running that shows all the running notebooks (i.e. kernels) and allows shutting them down (by clicking on a Shutdown button).


2 Answers

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

like image 92
jbcoe Avatar answered Oct 14 '22 13:10

jbcoe


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

like image 35
George L Avatar answered Oct 14 '22 15:10

George L