1

I’m new to JupyterHub and trying to install it on my VM. I’m following the instructions as mentioned on the page: https://jupyterhub.readthedocs.io/en/stable/installation-guide-hard.html. As mentioned at the step “Create the configuration for JupyterHub” I’m running the command to generate the default configuration file:

sudo /opt/jupyterhub/bin/jupyterhub --generate-config

But i’m getting the error “commnad not found”. Please help, I’m stuck in the middle of the installation.

enter image description here

Edit1: When I start typing the command sudo /opt/jupyterhub/bin/jupyterhub till /bin, I press TAB and the path auto appears. But, the /jupyterhub won't appear as this is not present there. Is this the cause for the error?

Surya Dilip I
  • 403
  • 1
  • 4
  • 6
  • You probably didn’t activate the virtual environment since the instructions seem to miss that step so your installations didn’t go where they’re supposed to – Sami Kuhmonen Mar 12 '21 at 04:51
  • You mean to say I did not execute the command 'sudo python3 -m venv /opt/jupyterhub/', no... I ran the command according to the document. I added a new edit in the question, can that be the reason? – Surya Dilip I Mar 12 '21 at 09:08
  • That command just creates a virtual environment, but it won’t activate it. You’d need to do `source /opt/jupyterhub/bin/activate` to activate it. You’ll see a change in the prompt when you are inside a venv. The instructions skip that part entirely – Sami Kuhmonen Mar 12 '21 at 09:30
  • Hi @SamiKuhmonen, you were right. I executed the command and the prompt changed to (jupyterhub) [root@localhost ~]# Now I did everything from start as mentioned in the documentation. When I run the command I get the same error. As mentioned earlier after /bin, /jupyterhub path is not present, is that causing the error? I/P: (jupyterhub) [root@localhost jupyterhub]# sudo /opt/jupyterhub/bin/jupyterhub --generate-config O/P: sudo: /opt/jupyterhub/bin/jupyterhub: command not found – Surya Dilip I Mar 12 '21 at 13:05

1 Answers1

0

The instructions seem to be missing a part. They instruct you to create the virtual environment but not to activate it. This means all the installed packages go to the system, not to the environment creates. You need to run

source /opt/jupyterhub/bin/activate

to activate it. The prompt will change to denote you’re in a virtual environment. After that all packages installed with pip will go to that environment and the commands should work. So continue from the installation onwards.

You may also want to uninstall the packages from the system if you only want them in the virtual environment.

Sami Kuhmonen
  • 30,146
  • 9
  • 61
  • 74