繁体   English   中英

如何解决错误:ModuleNotFoundError: No module named 'jupyterhub'

[英]How can I solve the error: ModuleNotFoundError: No module named 'jupyterhub'

我正在尝试在 CentOS 7 上安装和配置 JupyterHub,但我得到以下信息:

Feb 12 18:28:10 hostname.org jupyterhub: [I 2020-02-12 18:28:10.826 JupyterHub log:174] 302 POST /hub/login?next= -> /hub/spawn (meuser@172.69.69.69) 309.19ms
Feb 12 18:28:11 hostname.org systemd: Started Session c9 of user meuser.
Feb 12 18:28:11 hostname.org jupyterhub: [I 2020-02-12 18:28:11.302 JupyterHub spawner:1417] Spawning jupyterhub-singleuser --ip=10.10.10.10 --port=51914 --NotebookApp.default_url=/tree/home/meuser
Feb 12 18:28:11 hostname.org jupyterhub: Traceback (most recent call last):
Feb 12 18:28:11 hostname.org jupyterhub: File "/usr/local/bin/jupyterhub-singleuser", line 7, in <module>
Feb 12 18:28:11 hostname.org jupyterhub: from jupyterhub.singleuser import main
Feb 12 18:28:11 hostname.org jupyterhub: ModuleNotFoundError: No module named 'jupyterhub'
Feb 12 18:28:11 hostname.org jupyterhub: [I 2020-02-12 18:28:11.986 JupyterHub log:174] 302 GET /hub/spawn -> /hub/spawn-pending/meuser (meuser@172.69.69.69) 1016.77ms
Feb 12 18:28:12 hostname.org jupyterhub: [I 2020-02-12 18:28:12.080 JupyterHub pages:347] meuser is pending spawn
Feb 12 18:28:12 hostname.org jupyterhub: [I 2020-02-12 18:28:12.087 JupyterHub log:174] 200 GET /hub/spawn-pending/meuser (meuser@172.69.69.69) 15.77ms
Feb 12 18:28:20 hostname.org jupyterhub: ERROR:asyncio:Task exception was never retrieved
Feb 12 18:28:20 hostname.org jupyterhub: future: <Task finished coro=<BaseHandler.spawn_single_user() done, defined at /opt/jupyterhub/lib64/python3.6/site-packages/jupyterhub/handlers/base.py:741> exception=HTTPError()>
Feb 12 18:28:20 hostname.org jupyterhub: Traceback (most recent call last):
Feb 12 18:28:20 hostname.org jupyterhub: File "/opt/jupyterhub/lib64/python3.6/site-packages/jupyterhub/handlers/base.py", line 939, in spawn_single_user
Feb 12 18:28:20 hostname.org jupyterhub: timedelta(seconds=self.slow_spawn_timeout), finish_spawn_future
Feb 12 18:28:20 hostname.org jupyterhub: tornado.util.TimeoutError: Timeout
Feb 12 18:28:20 hostname.org jupyterhub: During handling of the above exception, another exception occurred:
Feb 12 18:28:20 hostname.org jupyterhub: Traceback (most recent call last):
Feb 12 18:28:20 hostname.org jupyterhub: File "/opt/jupyterhub/lib64/python3.6/site-packages/jupyterhub/handlers/base.py", line 972, in spawn_single_user
Feb 12 18:28:20 hostname.org jupyterhub: % (status, spawner._log_name),
Feb 12 18:28:20 hostname.org jupyterhub: tornado.web.HTTPError: HTTP 500: Internal Server Error (Spawner failed to start [status=1]. The logs for meuser may contain details.)
Feb 12 18:28:40 hostname.org jupyterhub: [W 2020-02-12 18:28:40.341 JupyterHub user:692] meuser's server never showed up at http://10.10.10.10:51914/user/meuser/ after 30 seconds. Giving up
Feb 12 18:28:40 hostname.org jupyterhub: [E 2020-02-12 18:28:40.390 JupyterHub gen:599] Exception in Future <Task finished coro=<BaseHandler.spawn_single_user.<locals>.finish_user_spawn() done, defined at /opt/jupyterhub/lib64/python3.6/site-packages/jupyterhub/handlers/base.py:845> exception=TimeoutError("Server at http://10.10.10.10:51914/user/meuser/ didn't respond in 30 seconds",)> after timeout

我按照以下有关在 CentOS 7 上安装 JupyterHub 的说明进行操作:不使用 Conda,使用 pip 和 NPM 安装 Jupyter 这里报告了一个类似的问题: GitHub 2276和我唯一的冲突是当我运行命令head -n 1 $(which jupyterhub)报告#!/bin/python3以及当我运行命令which -a python3我获取/usr/bin/python3 这是一个问题吗? 如果是这样,我该如何解决这个问题?

出现此错误是因为 site-packages 目录的权限为 700。对此的解决方案是递归地将所有读取和执行权限添加到/opt/jupyterhub/lib64/python3.6/site-packages目录。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM