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

时间:2018-04-02 00:38:33

标签: python azure jupyter-notebook jupyterhub azure-dsvm

我按照说明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,它会抛出与以前相同的错误。

2 个答案:

答案 0 :(得分:1)

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

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

答案 1 :(得分:0)

这是由于已经在深度学习VM的更高版本上修复的错误引起的。

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