remove kernel on jupyter notebook

RJupyter Notebook

R Problem Overview


How can I remove a kernel from jupyter notebook?

I have R kernel on my jupyter notebook. Recently kernel always dies right after I open a new notebook.

R Solutions


Solution 1 - R

Run jupyter kernelspec list to get the paths of all your kernels.
Then simply uninstall your unwanted-kernel

jupyter kernelspec uninstall unwanted-kernel

Old answer
Delete the folder corresponding to the kernel you want to remove.

The docs has a list of the common paths for kernels to be stored in: http://jupyter-client.readthedocs.io/en/latest/kernels.html#kernelspecs

Solution 2 - R

You can delete it in the terminal via:

jupyter kernelspec uninstall yourKernel

where yourKernel is the name of the kernel you want to delete.

Solution 3 - R

jupyter kernelspec remove now exists, see #7934.

So you can just.

# List all kernels and grap the name of the kernel you want to remove
jupyter kernelspec list
# Remove it
jupyter kernelspec remove <kernel_name>

That's it.

Solution 4 - R

There two ways, what I found either go to the directory where kernels are residing and delete from there. Secondly, using this command below

List all kernels and grap the name of the kernel you want to remove

 jupyter kernelspec list 

to get the paths of all your kernels.

Then simply uninstall your unwanted-kernel

jupyter kernelspec remove kernel_name

Solution 5 - R

Just for completeness, you can get a list of kernels with jupyter kernelspec list, but I ran into a case where one of the kernels did not show up in this list. You can find all kernel names by opening a Jupyter notebook and selecting Kernel -> Change kernel. If you do not see everything in this list when you run jupyter kernelspec list, try looking in common Jupyter folders:

ls ~/.local/share/jupyter/kernels  # usually where local kernels go
ls /usr/local/share/jupyter/kernels  # usually where system-wide kernels go
ls /usr/share/jupyter/kernels  # also where system-wide kernels can go

Also, you can delete a kernel with jupyter kernelspec remove or jupyter kernelspec uninstall. The latter is an alias for remove. From the in-line help text for the command:

uninstall
    Alias for remove
remove
    Remove one or more Jupyter kernelspecs by name.

Solution 6 - R

In jupyter notebook run:

!echo y | jupyter kernelspec uninstall unwanted-kernel 

In anaconda prompt run:

jupyter kernelspec uninstall unwanted-kernel

Solution 7 - R

If you are doing this for virtualenv, the kernels in inactive environments might not be shown with jupyter kernelspec list, as suggested above. You can delete it from directory:

~/.local/share/jupyter/kernels/

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionzeslaView Question on Stackoverflow
Solution 1 - RLouise DaviesView Answer on Stackoverflow
Solution 2 - RdopexxxView Answer on Stackoverflow
Solution 3 - RRomainView Answer on Stackoverflow
Solution 4 - RMohit SharmaView Answer on Stackoverflow
Solution 5 - REngineeroView Answer on Stackoverflow
Solution 6 - RdhgoratelaView Answer on Stackoverflow
Solution 7 - RFakabbir AminView Answer on Stackoverflow