Remove "base" JupyterHub kernel from kernelspec

I’ve posted this on the github issues page, so I’m not sure of the cross-posting etiquite… but maybe the Discourse server has more engagement than the issues page. anyway…

I have created a python environment with JupyterHub, and all of its support packages, installed. My goal is to keep this environment “clean”, with only Jupyter/JupyterHub-related packages installed, so I carefully manage updates and deployment.

I have added a couple other kernels to the kernelspec list that are to be used by my JuptyerHub end-users for particular use-cases, particular versions of python, etc. All of these kernels are available in the Jupyter Lab launcher for the user to select, and all are listed here:

jupyter kernelspec list
Available kernels:
  python3        /home/<snip>/miniconda3/envs/jupyterhub/lib/python3.7/site-packages/ipykernel/resources
  datascience    /home/<snip>/miniconda3/envs/jupyterhub/share/jupyter/kernels/datascience
  py27           /home/<snip>/miniconda3/envs/jupyterhub/share/jupyter/kernels/py27

I would like to remove the “base” python3 kernel from the JupyterLab Launcher, since this kernel is not intended for general purpose use, and doesn’t contain any useful packages for end-users. But juptyer won’t let me remove that one, presumably because it’s the built-in, default kernel.

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

Is there any way to remove this kernel from the kernelspec, or otherwise hide it in the Launcher so users can’t select it?

This was solved in the github Issues.

See for fix/workaround