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

标签 python jupyter-notebook centos jupyter jupyter-lab

我正在尝试在 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:Install Jupyter不使用 Conda,使用 pip 和 NPM。这里报告了一个类似的问题:GitHub 2276我唯一的冲突是当我运行命令 head -n 1 $(which jupyterhub) 时报告 #!/bin/python3当我运行命令 which -a python3我得到 /usr/bin/python3 .这是一个问题吗?如果是这样,我该如何解决这个问题?

最佳答案

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

关于python - 如何解决错误 : ModuleNotFoundError: No module named 'jupyterhub' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60198714/

相关文章:

python - 获取全局python脚本中当前目录的方法

python (VTK) : Connect two 3D points by an oriented cylinder

jupyter-notebook - 修改或钩入 Jupyter 的 tab 补全

compilation - 使用 --enable-pcntl 在 centos 上编译 php5

linux - 更改/etc 权限后 SSH 拒绝在 CentOS 上连接

带有扭曲 react 器的 Python 多处理

python - 从不同文件夹导入文件

python - 在ubuntu EC2深度学习实例中通过jupyter笔记本从s3读取数据

java - NotADirectoryError:[Errno 20]不是目录:'java'

php - 在后台centos服务器运行php脚本