I recently updated DockerSpawner image as I needed to add some new Python packages to server with no access to the internet (hence users can not install new packages using “pip install”.)
I stopped the jupyterhub systemd service, changed path to the new docker image in jupyterhub config file and restarted the service.
When I switch into new container (using the new image) and list the python packages, the newly installed packages are listed. They are also listed when creating new Terminal inside Jupyterhub.
The problem is that the packages are found when creating new Python 3 notebook, so the users can not use newly installed packages.
I used following command to list installed packages inside Jupyterhub Python 3 notebook:
import pip #needed to use the pip functions
for i in pip.get_installed_distributions(local_only=True):