Add a python runtime

I have few python runtimes located in my home directory. /u/py/anaconda1, /u/py/anaconda2, /u/py/anaconda3.
I would like to have Jupyterhub see these runtimes. How do I do that?

You need to install ipython in those environments.

Then you can “install” the kernel spec and make it visible to Jupyter clients:

ipython kernel install --user --name <name> --display-name <name>`.

The --name <name> will be the filename of the kernel, and the --display-name <name> will be the name shown in the kernel list in Jupyter Notebook/Lab. You can omit --display-name, then it will just re-use the filename.

In the case of Conda specifically, you can also make all of your Conda environments automatically visible to Jupyter with the nb_conda_kernels package. This package should be installed in the same environment that you use to run Jupyter, not in the various Conda environments that you want to use as kernels.