无法连接到JupyterHub(使用Python 3)-错误消息:[Errno 8]未提供节点名或服务名,或未知

mwkjh3gx  于 2022-12-20  发布在  Python
关注(0)|答案(2)|浏览(143)

安装后无法连接到JupyterHub

我刚刚安装了JupyterHub和一个新的安装在pip 3上。我的操作系统是MacOS Sierra。它似乎有点奇怪,它试图连接到Malins-Macbook-Air。当我在终端输入$HOSTNAME时,我得到一个空字符串,而当我输入hostname时,它给我一个Malins-Macbook-Air. local。
当我尝试连接到jupyterHub时,我收到以下错误:

⋊> ~/S/I/inf5860_oblig1 on master ⨯ jupyterhub                                                                                                                     17:44:39
[I 2018-02-01 17:44:42.484 JupyterHub app:834] Loading cookie_secret from /Users/malinaandahl/Skole/INF5860/inf5860_oblig1/jupyterhub_cookie_secret
[W 2018-02-01 17:44:42.518 JupyterHub app:955] No admin users, admin interface will be unavailable.
[W 2018-02-01 17:44:42.519 JupyterHub app:956] Add any administrative users to `c.Authenticator.admin_users` in config.
[I 2018-02-01 17:44:42.519 JupyterHub app:983] Not using whitelist. Any authenticated user will be allowed.
[I 2018-02-01 17:44:42.566 JupyterHub app:1528] Hub API listening on http://127.0.0.1:8081/hub/
[W 2018-02-01 17:44:42.568 JupyterHub proxy:415]
    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 2018-02-01 17:44:42.569 JupyterHub proxy:456] Running JupyterHub without SSL.  I hope there is SSL termination happening somewhere else...
[I 2018-02-01 17:44:42.569 JupyterHub proxy:458] Starting proxy @ http://*:8000/
17:44:42.771 - info: [ConfigProxy] Proxying http://*:8000 to (no default)
17:44:42.779 - info: [ConfigProxy] Proxy API at http://127.0.0.1:8001/api/routes
[E 2018-02-01 17:44:47.582 JupyterHub utils:47] Unexpected error connecting to Malins-MacBook-Air.local:8000 [Errno 8] nodename nor servname provided, or not known
[E 2018-02-01 17:44:52.590 JupyterHub utils:47] Unexpected error connecting to Malins-MacBook-Air.local:8000 [Errno 8] nodename nor servname provided, or not known
[E 2018-02-01 17:44:57.597 JupyterHub utils:47] Unexpected error connecting to Malins-MacBook-Air.local:8000 [Errno 8] nodename nor servname provided, or not known
[E 2018-02-01 17:45:02.605 JupyterHub utils:47] Unexpected error connecting to Malins-MacBook-Air.local:8000 [Errno 8] nodename nor servname provided, or not known
[E 2018-02-01 17:45:07.619 JupyterHub utils:47] Unexpected error connecting to Malins-MacBook-Air.local:8000 [Errno 8] nodename nor servname provided, or not known
[E 2018-02-01 17:45:12.634 JupyterHub utils:47] Unexpected error connecting to Malins-MacBook-Air.local:8000 [Errno 8] nodename nor servname provided, or not known
[E 2018-02-01 17:45:17.644 JupyterHub utils:47] Unexpected error connecting to Malins-MacBook-Air.local:8000 [Errno 8] nodename nor servname provided, or not known
[E 2018-02-01 17:45:22.652 JupyterHub utils:47] Unexpected error connecting to Malins-MacBook-Air.local:8000 [Errno 8] nodename nor servname provided, or not known
[E 2018-02-01 17:45:27.659 JupyterHub utils:47] Unexpected error connecting to Malins-MacBook-Air.local:8000 [Errno 8] nodename nor servname provided, or not known
[E 2018-02-01 17:45:32.668 JupyterHub utils:47] Unexpected error connecting to Malins-MacBook-Air.local:8000 [Errno 8] nodename nor servname provided, or not known
[E 2018-02-01 17:45:37.676 JupyterHub utils:47] Unexpected error connecting to Malins-MacBook-Air.local:8000 [Errno 8] nodename nor servname provided, or not known
[C 2018-02-01 17:45:37.677 JupyterHub app:1535] Failed to start proxy
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/jupyterhub/app.py", line 1533, in start
        yield self.proxy.start()
      File "/usr/local/lib/python3.6/site-packages/jupyterhub/proxy.py", line 489, in start
        yield server.wait_up(1)
      File "/usr/local/lib/python3.6/site-packages/jupyterhub/utils.py", line 146, in wait_for_server
        timeout=timeout
      File "/usr/local/lib/python3.6/site-packages/jupyterhub/utils.py", line 135, in exponential_backoff
        raise TimeoutError(fail_message)
    TimeoutError: Server at Malins-MacBook-Air.local:8000 didn't respond in 1 seconds

我试着运行sudo jupyterhub,它给了我同样的错误信息。jupyter故障排除的输出:

$PATH:
    /usr/local/bin
    /usr/local/bin
    /usr/bin
    /bin
    /usr/sbin
    /sbin
    /opt/X11/bin
    /usr/local/git/bin
    /Library/TeX/texbin

sys.path:
    /usr/local/bin
    /usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python36.zip
    /usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6
    /usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload
    /usr/local/lib/python3.6/site-packages

sys.executable:
    /usr/local/opt/python3/bin/python3.6

sys.version:
    3.6.4 (default, Jan  6 2018, 11:51:15)
    [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]

platform.platform():
    Darwin-16.7.0-x86_64-i386-64bit

which -a jupyter:
    /usr/local/bin/jupyter
    /usr/local/bin/jupyter

pip list:
    alembic (0.9.7)
    appnope (0.1.0)
    bleach (2.1.2)
    certifi (2018.1.18)
    chardet (3.0.4)
    decorator (4.2.1)
    entrypoints (0.2.3)
    html5lib (1.0.1)
    idna (2.6)
    ipykernel (4.8.0)
    ipython (6.2.1)
    ipython-genutils (0.2.0)
    jedi (0.11.1)
    Jinja2 (2.10)
    jsonschema (2.6.0)
    jupyter-client (5.2.2)
    jupyter-core (4.4.0)
    jupyterhub (0.8.1)
    Mako (1.0.7)
    MarkupSafe (1.0)
    mistune (0.8.3)
    nbconvert (5.3.1)
    nbformat (4.4.0)
    notebook (5.4.0)
    pamela (0.3.0)
    pandocfilters (1.4.2)
    parso (0.1.1)
    pexpect (4.3.1)
    pickleshare (0.7.4)
    pip (9.0.1)
    prompt-toolkit (1.0.15)
    ptyprocess (0.5.2)
    Pygments (2.2.0)
    python-dateutil (2.6.1)
    python-editor (1.0.3)
    python-oauth2 (1.0.1)
    pyzmq (16.0.4)
    requests (2.18.4)
    Send2Trash (1.4.2)
    setuptools (38.4.0)
    simplegeneric (0.8.1)
    six (1.11.0)
    SQLAlchemy (1.2.2)
    terminado (0.8.1)
    testpath (0.3.1)
    tornado (4.5.3)
    traitlets (4.3.2)
    urllib3 (1.22)
    wcwidth (0.1.7)
    webencodings (0.5.1)
    wheel (0.30.0)
6qftjkof

6qftjkof1#

这个问题被张贴在这里,以防任何人有同样的问题:https://github.com/jupyterhub/jupyterhub/issues/1586

svujldwt

svujldwt2#

为我的错误:

Unexpected error connecting to d7f9ec442130:8123 [Errno -2] Name or service not known

我编辑文件/etc/hosts并添加新行d7f9ec442130 127.0.0.1
对我很有效。
ref. to : https://github.com/jupyterhub/jupyterhub/issues/1586#issuecomment-469318376

相关问题