Is it possible to have different kernels (environments) for each user?


I have successfully install Jupyterhub in a DigitalOcean Droplet for my students. I suposse that all the users share the same environment… Isn’t it? The question is if it possible to have different kernels (environments) for each user¿?

Thanks in advance!

Configuring user environments depends on what Spawner you use, e.g. docker containers or users on the system.

If you are using regular system users with home directories (i.e. JupyterHub’s default behavior), you can install packages with --user and they will be available to only one user at a time. For example, a user can do:

python3 -m pip install --user pandas

and they will have their own install of pandas in their default environment.

They could also create a new virtual environment and register a kernelspec for it:

# create and activate the env
python3 -m venv ~/myenv
source ~/myenv/bin/activate

# install some packages. ipykernel is what's needed to use it as a kernel
python3 -m pip install ipykernel pandas matplotlib
# register this env as a kernel available for new notebooks
# --user means only register it *for this user*
python3 -m ipykernel install --user --name myenv
1 Like

Thank you for your answer Minrk. I’m using TLJH and it seems not working with my ubuntu system users. I tried to get how to configure it using this URL Configuring JupyterHub authenticators — The Littlest JupyterHub v0.1 documentation but it seems none of them links TLJH with system users…

Any help?

Thanks in advance!