Jupyterhub does not recognize my config

hey folks!

i installed jupyterhub using apt in ubuntu 24.04 and install dockerspawner using pip on system level.

then i use this config file for jupyterhub

c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
c.DockerSpawner.image = 'jupyter/base-notebook'
c.DockerSpawner.remove = True
c.DockerSpawner.debug = True
c.DockerSpawner.extra_create_kwargs.update({
    'runtime': 'nvidia',
    'environment': {
        'NVIDIA_VISIBLE_DEVICES': 'all'  # Adjust GPU allocation as needed
    }
})
c.DockerSpawner.volumes = {
    'jupyterhub-user-{username}': '/home/jovyan/work',
    # Add shared volumes if needed
    'jupyterhub-shared': '/home/jovyan/shared'
}

but when i run jupyterhub using this command

sudo /usr/bin/python3 -m jupyterhub.app -f /etc/jupyterhub/config/jupyterhub_config.d/config.yaml --upgrade-db --debug

i get this line

Using Spawner: jupyterhub.spawner.LocalProcessSpawner-3.0.0

do you know what is wrong with this config?

JupyterHub expects the configuration file to be a python file, it doesn’t load any YAML configuration files by default, so this must be a customisation in the Ubuntu package. You could try searching the Ubuntu documentation to see what customisations have made to JupyterHub.

Alternatively you could ignore that, and run JupyterHub directly:

jupyterhub -f jupyterhub_config.py --debug

where jupyterhub_config.py is the config file you’ve included in your original post.

2 Likes