jupyterhub / the-littlest-jupyterhub

Simple JupyterHub distribution for 1-100 users on a single server
https://tljh.jupyter.org
BSD 3-Clause "New" or "Revised" License
1.04k stars 341 forks source link

Timeout starting user server: ModuleNotFoundError: No module named 'dateutil' #180

Closed suhailrehman closed 3 years ago

suhailrehman commented 6 years ago

Have been trying to get this to work, but always get a spawning timeout when starting the individual jupyterhub server for a user, logs indicate an import issue. Have followed all instructions as noted in the main page.

Sep 14 13:12:49 suhail-lab systemd[1]: Started /bin/bash -c cd /home/jupyter-suhail && exec jupyterhub-singleuser --port=55541.
Sep 14 13:12:50 suhail-lab bash[2722]: Traceback (most recent call last):
Sep 14 13:12:50 suhail-lab bash[2722]:   File "/opt/tljh/user/bin/jupyterhub-singleuser", line 3, in <module>
Sep 14 13:12:50 suhail-lab bash[2722]:     from jupyterhub.singleuser import main
Sep 14 13:12:50 suhail-lab bash[2722]:   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterhub/singleuser.py", line 34, in <module>
Sep 14 13:12:50 suhail-lab bash[2722]:     from notebook.notebookapp import (
Sep 14 13:12:50 suhail-lab bash[2722]:   File "/opt/tljh/user/lib/python3.6/site-packages/notebook/notebookapp.py", line 80, in <module>
Sep 14 13:12:50 suhail-lab bash[2722]:     from .services.kernels.kernelmanager import MappingKernelManager
Sep 14 13:12:50 suhail-lab bash[2722]:   File "/opt/tljh/user/lib/python3.6/site-packages/notebook/services/kernels/kernelmanager.py", line 19, in <module>
Sep 14 13:12:50 suhail-lab bash[2722]:     from jupyter_client.session import Session
Sep 14 13:12:50 suhail-lab bash[2722]:   File "/opt/tljh/user/lib/python3.6/site-packages/jupyter_client/session.py", line 61, in <module>
Sep 14 13:12:50 suhail-lab bash[2722]:     from jupyter_client.jsonutil import extract_dates, squash_dates, date_default
Sep 14 13:12:50 suhail-lab bash[2722]:   File "/opt/tljh/user/lib/python3.6/site-packages/jupyter_client/jsonutil.py", line 11, in <module>
Sep 14 13:12:50 suhail-lab bash[2722]:     from dateutil.parser import parse as _dateutil_parse
Sep 14 13:12:50 suhail-lab bash[2722]: ModuleNotFoundError: No module named 'dateutil'
Sep 14 13:12:50 suhail-lab systemd[1]: jupyter-suhail.service: Main process exited, code=exited, status=1/FAILURE
Sep 14 13:12:50 suhail-lab systemd[1]: jupyter-suhail.service: Failed with result 'exit-code'.
Sep 14 13:15:13 suhail-lab systemd[1]: Started /bin/bash -c cd /home/jupyter-suhail && exec jupyterhub-singleuser --port=55541.
Sep 14 13:15:13 suhail-lab bash[3029]: Traceback (most recent call last):
Sep 14 13:15:13 suhail-lab bash[3029]:   File "/opt/tljh/user/bin/jupyterhub-singleuser", line 3, in <module>
Sep 14 13:15:13 suhail-lab bash[3029]:     from jupyterhub.singleuser import main
Sep 14 13:15:13 suhail-lab bash[3029]:   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterhub/singleuser.py", line 34, in <module>
Sep 14 13:15:13 suhail-lab bash[3029]:     from notebook.notebookapp import (
Sep 14 13:15:13 suhail-lab bash[3029]:   File "/opt/tljh/user/lib/python3.6/site-packages/notebook/notebookapp.py", line 80, in <module>
Sep 14 13:15:13 suhail-lab bash[3029]:     from .services.kernels.kernelmanager import MappingKernelManager
Sep 14 13:15:13 suhail-lab bash[3029]:   File "/opt/tljh/user/lib/python3.6/site-packages/notebook/services/kernels/kernelmanager.py", line 19, in <module>
Sep 14 13:15:13 suhail-lab bash[3029]:     from jupyter_client.session import Session
Sep 14 13:15:13 suhail-lab bash[3029]:   File "/opt/tljh/user/lib/python3.6/site-packages/jupyter_client/session.py", line 61, in <module>
Sep 14 13:15:13 suhail-lab bash[3029]:     from jupyter_client.jsonutil import extract_dates, squash_dates, date_default
Sep 14 13:15:13 suhail-lab bash[3029]:   File "/opt/tljh/user/lib/python3.6/site-packages/jupyter_client/jsonutil.py", line 11, in <module>
Sep 14 13:15:13 suhail-lab bash[3029]:     from dateutil.parser import parse as _dateutil_parse
Sep 14 13:15:13 suhail-lab bash[3029]: ModuleNotFoundError: No module named 'dateutil'
Sep 14 13:15:13 suhail-lab systemd[1]: jupyter-suhail.service: Main process exited, code=exited, status=1/FAILURE
Sep 14 13:15:13 suhail-lab systemd[1]: jupyter-suhail.service: Failed with result 'exit-code'.
JulianKling commented 5 years ago

Same problem for me ATM

EdenTDatalytyx commented 5 years ago

Solved this by doing the following:

sudo su -
source /opt/tljh/user/bin/activate
pip install python-dateutil
source /opt/tljh/user/bin/deactivate
exit

This should get you into the virtual environment that was created by root to run the server in, then install the right module, then exit you out again.

Funatiq commented 4 years ago

Thank you for the solution. Why is this still not fixed?

consideRatio commented 3 years ago

I'm not sure why there would be an issue with this, the python-dateutil package has been a requirement of jupyter_client since 18 december 2017.

I'll go ahead this is actually resolved, but if it isn't, please comment about it and do an inspection of the packages available in the user environment with:

sudo su -
source /opt/tljh/user/bin/activate
pip freeze