Removing "extra" kernel

1,250 views
Skip to first unread message

d...@deej.net

unread,
Apr 27, 2018, 11:00:35 AM4/27/18
to Project Jupyter
I am setting up Jupyter Hub for the first time, and I have no previous experience with the Jupyter systems, and request a little handholding.

I have successfully setup Jupyter to create notebooks using Python 2.7, 3.4, and 3.6 as well as R.  My custom entries are all in subdirectories of /usr/share/jupyter/kernels.

There is an "extra" kernel that I can't figure out how to remove, labeled "python3".  From the command line I can see:

# jupyter kernelspec list
Available kernels:
  python3      /usr/lib/python3.4/site-packages/ipykernel/resources
  ir           /usr/share/jupyter/kernels/ir
  python2.7    /usr/share/jupyter/kernels/python2.7
  python3.4    /usr/share/jupyter/kernels/python3.4
  python3.6    /usr/share/jupyter/kernels/python3.6

# jupyter kernelspec remove python3
Couldn't find kernel spec(s): python3

How do I get rid of this, or at least prevent it from showing up in the "New notebook" dropdown box within Jupyterhub?

Thanks,

-Dj

Thomas Kluyver

unread,
Apr 27, 2018, 11:30:37 AM4/27/18
to Project Jupyter
It's a special fallback which Jupyter will always find if it can import the ipykernel package. The easiest way to 'get rid' of it is to use the name 'python3' for one of your other kernels (probably the python 3.6 one).

If all of your kernels are in separate environments from your notebook server, you can also get rid of it by removing the 'ipykernel' package.

There is also a config option KernelSpecManager.whitelist, but it's a bit clumsy to use it for this, because you'd have to update it any time you add another kernel.

Thomas

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/458f3e3c-93fd-4460-8ff1-dd016652b0c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Damián Avila

unread,
Apr 27, 2018, 12:08:29 PM4/27/18
to jup...@googlegroups.com
There is an option to get rid of the native kernel, set the following option to False:

KernelSpecManager.ensure_native_kernel : Bool

Default: True

If there is no Python kernelspec registered and the IPython kernel is available, ensure it is added to the spec list.

I think that could help if I understood the requirement correctly.

Cheers.



For more options, visit https://groups.google.com/d/optout.



--
Damián Avila

Thomas Kluyver

unread,
Apr 27, 2018, 12:46:03 PM4/27/18
to Project Jupyter
I'd completely forgotten that was there. Thanks Damián!

d...@deej.net

unread,
Apr 27, 2018, 1:02:36 PM4/27/18
to Project Jupyter
Thanks all.

Adding
KernelSpecManager.whitelist="python2.7, python3.4, python3.6, ir"
to the config files results in:

run-jupyterhub: KernelSpecManager.whitelist="python2.7, python3.4, python3.6, ir"
run-jupyterhub: NameError: name 'KernelSpecManager' is not defined

Similarly,

run-jupyterhub: KernelSpecManager.ensure_native_kernel = False
run-jupyterhub: NameError: name 'KernelSpecManager' is not defined

From another reference, I tried:
run-jupyterhub: MultiKernelManager.default_kernel_name="python3.4"
run-jupyterhub: NameError: name 'MultiKernelManager' is not defined



Thomas Kluyver

unread,
Apr 27, 2018, 1:08:09 PM4/27/18
to Project Jupyter
All the names in the Python config file start with "c."

Here's the docs for more information:
http://jupyter.readthedocs.io/en/latest/projects/config.html

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.

d...@deej.net

unread,
Apr 27, 2018, 1:23:57 PM4/27/18
to Project Jupyter
Thank you.

Changing the config file entries to read:
c.KernelSpecManager.whitelist="python2.7, python3.4, python3.6, ir"
c.MultiKernelManager.default_kernel_name="python3.4"
c.KernelSpecManager.ensure_native_kernel = False


get rid of the startup errors, however, the "python3" entry still shows up in the pull down list.

Then I tried starting jupyterhub with a command line option:
jupyterhub '--KernelSpecManager.whitelist=["python2.7", "python3.4", "python3.6", "ir"]'

and "python3" still appears in the list.

-Dj

d...@deej.net

unread,
Apr 27, 2018, 1:38:17 PM4/27/18
to Project Jupyter
Also tried:
jupyterhub '--KernelSpecManager.ensure_native_kernel=False'

and "python3" is still in the list.


d...@deej.net

unread,
Apr 27, 2018, 2:01:44 PM4/27/18
to Project Jupyter
c.Spawner.args = ["--KernelSpecManager.ensure_native_kernel=False"]

seems to have done the trick.

Thanks for the hints leading me in the right direction!  :-)

-Dj


Thomas Kluyver

unread,
Apr 27, 2018, 6:10:53 PM4/27/18
to Project Jupyter
Aha, I'd forgotten jupyterhub was involved. The config for the hub is separate from the config for notebook servers. But you can affect the notebook servers config from the hub using spawner args.

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages