无法访问 Azure 深度学习虚拟机上的 Jupyter 笔记本

Can't reach Jupyter Notebooks on Azure Deep Learning Virtual Machine

我遵循了说明 here

我通过 SSH 在 Ubuntu VM 上。 我试图访问 IP:8000 但 Chrome 说无法访问该站点。如文档中所述,端口 8000 确实默认打开。

说明中没有提到我是否必须开始 jupyterhub 所以我尝试了这个并得到了这个错误 -

username@fastai:~ $ jupyterhub
[I 2018-04-02 00:25:41.018 JupyterHub app:871] Writing cookie_secret to /home/username/jupyterhub_cookie_secret
[I 2018-04-02 00:25:41.036 alembic.runtime.migration migration:117] Context impl SQLiteImpl.
[I 2018-04-02 00:25:41.037 alembic.runtime.migration migration:122] Will assume non-transactional DDL.
[I 2018-04-02 00:25:41.067 alembic.runtime.migration migration:327] Running stamp_revision  -> 3ec6993fe20c
[W 2018-04-02 00:25:41.388 JupyterHub app:955] No admin users, admin interface will be unavailable.
[W 2018-04-02 00:25:41.389 JupyterHub app:956] Add any administrative users to `c.Authenticator.admin_users` in config.
[I 2018-04-02 00:25:41.389 JupyterHub app:983] Not using whitelist. Any authenticated user will be allowed.
[E 2018-04-02 00:25:41.414 JupyterHub app:1525] Failed to bind hub to http://127.0.0.1:8081/hub/
[E 2018-04-02 00:25:41.414 JupyterHub app:1623]
    Traceback (most recent call last):
      File "/anaconda/envs/py35/lib/python3.5/site-packages/jupyterhub/app.py", line 1621, in launch_instance_async
        yield self.start()
      File "/anaconda/envs/py35/lib/python3.5/site-packages/jupyterhub/app.py", line 1523, in start
        self.http_server.listen(self.hub_port, address=self.hub_ip)
      File "/anaconda/envs/py35/lib/python3.5/site-packages/tornado/tcpserver.py", line 142, in listen
        sockets = bind_sockets(port, address=address)
      File "/anaconda/envs/py35/lib/python3.5/site-packages/tornado/netutil.py", line 197, in bind_sockets
        sock.bind(sockaddr)
    OSError: [Errno 98] Address already in use

在我阅读文档中有关 jupyterhub 的信息之前,我尝试启动 jupyter notebook,这给了我这个错误。

[C 04:00:12.963 NotebookApp] Bad config encountered during initialization:
[C 04:00:12.963 NotebookApp] No such notebook dir: ''/dsvm/Notebooks''

使用 jupyter notebook --generate-config 生成配置文件并编辑后似乎 运行 没问题,但尽管打开了所有端口,我仍然无法通过 Chrome 访问它。

更新
今天我安装了一个 X2Go 客户端并在桌面上找到了 jupyter notebook icon 但开始时抛出了这个错误 - 未能 运行 Jupyter.desktop 无法解析桌面文件:密钥文件包含行“/anaconda/pkgs/notebook-5.4.0-py27_0/info/icon.png”,它不是键值对、组或注释

看起来该文件调用了 jupyter notebook,它抛出了与之前相同的错误。

JupyterHub 在启动时应该 运行 在端口 8000 上。你能用 systemctl status jupyterhub 仔细检查它的状态吗?您是否在门户中仔细检查过端口 8000 是否已打开?

如果 JupyterHub 报告它 运行 并且正在侦听端口 8000,则可能是防火墙阻止了连接。在这种情况下,一些用户通过 SSH 转发端口 8000 成功,然后连接到 localhost:8000.

这是由一个错误引起的,该错误已在更高版本的深度学习 VM 上得到修复。

有关详细信息,请参阅 this Github issue