Jupyterhub on Centos7: ruamel.yaml error (Jupyter Notebook works)

Hi all

After installing JupyterHub via python3 pip, I get this error:

(base) root@host [~/.jupyter]# jupyterhub -hTraceback (most recent call last): File “/usr/local/bin/jupyterhub”, line 5, in
from jupyterhub.app import main
File “/usr/local/lib/python3.6/site-packages/jupyterhub/app.py”, line 64, in
from jupyter_telemetry.eventlog import EventLog
File “/usr/local/lib/python3.6/site-packages/jupyter_telemetry/init.py”, line 6, in
from .eventlog import EventLog # noqa
File “/usr/local/lib/python3.6/site-packages/jupyter_telemetry/eventlog.py”, line 10, in
from ruamel.yaml import YAML
ImportError: cannot import name ‘YAML’

I do have ruamel.yaml installed in /usr/lib64/python3.6/site-packages (version 0.13.14), and this Centos7 system works perfectly with a Notebook server.

Why is Jupyterhub not working and/or not seeing/searching installed modules properly?

You’ve mentioned two different Python environments, one under /usr/local and one under /usr/lib64. There’s no guarantee that packages from these two environments can be combined. To avoid these types of problems you can create an independent virtualenv instead and install everything in that.

Hi, thanks for your feedback, I thought the same but actually that system works perfectly with everything else. Looking into another forum for another software, I came to the fact that the problem lies into ruamel.yaml package, that gives problems quite often apparently.

The solution posted was to install instead a patched version of the same package, called ruamel_yaml, always via pip, and that solved the problem.