'JupyterHub installation in windows using docker

I want to install JupiterHub using Docker (my operating system is Windows). I have done the installation steps and I am running JupiterHab, when I login to jupyterhub as an admin or user in browser, I get the following error:

Spawn failed: Server at http://127.0.0.1:44325/user/zahra/ didn't respond in 30 seconds

i edited the jupyterhub config file and added these lines:

import pwd, subprocess

c.JupyterHub.authenticator_class = 'nativeauthenticator.NativeAuthenticator'

c.Authenticator.admin_users = {'admin'}

def pre_spawn_hook(spawner):

username = spawner.user.name

try:

    pwd.getpwnam(username)

except KeyError:

    subprocess.check_call(['useradd', '-ms', '/bin/bash', username])

c.Spawner.pre_spawn_hook = pre_spawn_hook

c.Spawner.default_url = '/lab'

Help me please



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source