Unable to start Jupyterhub server after login

Hi,

I have just installed jupyterhub in Ubuntu WSL and everything is installed as per instructions from Github page. But after logging in and starting my server I get below error message in web.

Spawn failed: [Errno 2] No such file or directory: 'jupyterhub-singleuser': 'jupyterhub-singleuser'

Below error message in terminal.

Unhandled error starting yaswanth's server: [Errno 2] No such file or directory: 'jupyterhub-singleuser': 'jupyterhub-singleuser'
ERROR:asyncio:Task exception was never retrieved
future: <Task finished coro=<BaseHandler.spawn_single_user() done, defined at /home/yaswanth/anaconda3/lib/python3.7/site-packages/jupyterhub/handlers/base.py:741> exception=FileNotFoundError(2, "No such file or directory: 'jupyterhub-singleuser'")>
Traceback (most recent call last):
  File "/home/yaswanth/anaconda3/lib/python3.7/site-packages/jupyterhub/handlers/base.py", line 939, in spawn_single_user
    timedelta(seconds=self.slow_spawn_timeout), finish_spawn_future
  File "/home/yaswanth/anaconda3/lib/python3.7/site-packages/jupyterhub/handlers/base.py", line 852, in finish_user_spawn
    await spawn_future
  File "/home/yaswanth/anaconda3/lib/python3.7/site-packages/jupyterhub/user.py", line 656, in spawn
    raise e
  File "/home/yaswanth/anaconda3/lib/python3.7/site-packages/jupyterhub/user.py", line 560, in spawn
    url = await gen.with_timeout(timedelta(seconds=spawner.start_timeout), f)
  File "/home/yaswanth/anaconda3/lib/python3.7/site-packages/jupyterhub/spawner.py", line 1427, in start
    self.proc = Popen(cmd, **popen_kwargs)
  File "/home/yaswanth/anaconda3/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/home/yaswanth/anaconda3/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'jupyterhub-singleuser': 'jupyterhub-singleuser'

However I have included location of jupyterhub-singleuser in my PATH and included in jupyterhub_config.py also.

c.Spawner.cmd = ['/home/yaswanth/anaconda3/bin/jupyterhub-singleuser']

Proxy is also configured and i have included it as absolute path. Below is my path for reference.

/home/yaswanth/anaconda3/bin:/home/yaswanth/.local/bin:/home/yaswanth/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2020.423.0_x64__79rhkp1fndgsc:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/Java/jdk-11.0.5/bin:/mnt/c/Program Files/Apache-Maven/apache-maven-3.6.3/bin:/mnt/c/Users/yaswa/AppData/Local/Programs/Python/Python38/Scripts:/mnt/c/Users/yaswa/AppData/Local/Programs/Python/Python38:/mnt/c/Users/yaswa/AppData/Local/Microsoft/WindowsApps:/snap/bin:/home/yaswanth/anaconda3/etc:/home/yaswanth/anaconda3/etc/jupyterhub:/usr/local/bin

Can anyone please help me how to overcome this issue and start the server successfully.

Hello yash,

I had the same problem and solved it by adding the anaconda path to the /etc/environment file

In my case it is the following route:

/opt/anaconda3/bin:$PATH