我正在尝试为多用户模式运行 jupyterhub:
sudo jupyterhub
我能够使用我用来安装 jupyterhub 的用户成功登录。但是,当我尝试与其他用户一起登录时,我收到以下消息:
500: Internal Server Error Spawner failed to start [status=1]
在终端:
user@server:~$ sudo jupyterhub
[I 2017-02-18 11:47:53.663 JupyterHub app:733] Loading cookie_secret from /home/user/jupyterhub_cookie_secret
[W 2017-02-18 11:47:53.691 JupyterHub app:372] Generating CONFIGPROXY_AUTH_TOKEN. Restarting the Hub will require restarting the proxy. Set CONFIGPROXY_AUTH_TOKEN env or JupyterHub.proxy_auth_token config to avoid this message.
[W 2017-02-18 11:47:53.695 JupyterHub app:874] No admin users, admin interface will be unavailable.
[W 2017-02-18 11:47:53.695 JupyterHub app:875] Add any administrative users to
c.Authenticator.admin_users
in config.[I 2017-02-18 11:47:53.695 JupyterHub app:902] Not using whitelist. Any authenticated user will be allowed.
[I 2017-02-18 11:47:53.714 JupyterHub app:1481] Hub API listening on http://127.0.0.1:8081/hub/
[W 2017-02-18 11:47:53.716 JupyterHub app:1201] Running JupyterHub without SSL. I hope there is SSL termination happening somewhere else...
[I 2017-02-18 11:47:53.716 JupyterHub app:1203] Starting proxy @ http://*:8000/
11:47:54.569 - info: [ConfigProxy] Proxying http://*:8000 to http://127.0.0.1:8081
11:47:54.574 - info: [ConfigProxy] Proxy API at http://127.0.0.1:8001/api/routes
[I 2017-02-18 11:47:54.597 JupyterHub app:1537] JupyterHub is now running at http://127.0.0.1:8000/
Last login: Sat Feb 18 00:26:34 CET 2017
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64)
Documentation: https://help.ubuntu.com
Management: https://landscape.canonical.com
Support: https://ubuntu.com/advantage
1 package can be updated.
0 updates are security updates.
[I 2017-02-18 11:48:10.990 JupyterHub spawner:785] Spawning jupyterhub-singleuser '--user="username"' '--cookie-name="jupyter-hub-token-username"' '--base-url="/user/username"' '--hub-host=""' '--hub-prefix="/hub/"' '--hub-api-url="http://127.0.0.1:8081/hub/api"' '--ip="127.0.0.1"' --port=52764
Traceback (most recent call last):
File "/usr/local/bin/jupyterhub-singleuser", line 4, in import('pkg_resources').require('jupyterhub==0.8.0.dev0') File
"/usr/local/lib/python3.5/dist-packages/pkg_resources/init.py", line 3036, in @_call_aside
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/init.py", line 3020, in _call_aside f(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/init.py", line 3049, in _initialize_master_working_set working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/init.py", line 654, in _build_master ws.require(requires)
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/init.py", line 968, in require needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/init.py", line 854, in resolve raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'jupyterhub==0.8.0.dev0' distribution was not found and is required by the application
[W 2017-02-18 11:48:21.038 JupyterHub web:1545] 500 POST /hub/login?next= (::ffff:10.90.0.4): Spawner failed to start [status=1]
[E 2017-02-18 11:48:21.066 JupyterHub log:99] {
"Content-Length": "36",
"Content-Type": "application/x-www-form-urlencoded",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US",
"Dnt": "1",
"Host": "zeno.lehre.hwr-berlin.de:8000",
"Cookie": "_xsrf=2|1204c4dd|f391c8200e87548242350a9d25406790|1487111102",
"X-Forwarded-Host": "server.com:8000",
"Connection": "close",
"X-Forwarded-For": "::ffff:...",
"X-Forwarded-Proto": "http",
"Accept": "text/html, application/xhtml+xml, /",
"Cache-Control": "no-cache",
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
"Referer": "http://server.com:8000/hub/login",
"X-Forwarded-Port": "8000"
}
[E 2017-02-18 11:48:21.066 JupyterHub log:100] 500 POST /hub/login?next= (@::ffff:...) 10283.44ms
我不知道这是否是问题的根源,但是,我有 jupyterhub 版本:0.7.0。我尝试使用以下方法将其更新为 0.8.0:
sudo pip install -U jupyterhub
但是,我得到了:
Requirement already up-to-date: ****
我尝试了很久才在网上找到解决方案;不过我失败了。
有人可以帮我解决这个问题吗?
谢谢 :)
最佳答案
你可以从源代码安装 jupyterhub 并看到这个日志:
“pkg_resources.DistributionNotFound: 'jupyterhub==0.8.0.dev0' 分发未找到,应用程序需要”
我遇到了同样的问题,并且...这是由安装二进制 jupyterhub 并且不安装软件包引起的...
执行后
pip3 install -r dev-requiremetns.txt .
日志让我们通过“运行 setup.py develop for jupyterhub”来执行 setup.py,然后运行
python setup.py build
和 python setup.py install
然后中止,日志让我使用pip install .
然后运行 pip3 install .
,然后jupyterhub正常运行。以下命令:
cd /path to git code/jupyterhub/
python setup.py build
python setup.py install
pip3 install .
关于Ubuntu Jupyterhub : 500 POST Spawner failed to start [status=1],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42314732/