iPython 笔记本无法连接到 google-compute-engine 上的内核

iPython notebook can't connect to kernel on google-compute-engine

我一直在尝试将 ipython/jupyter notebook 运行ning 作为 Google Compute Engine(Ubuntu 14.04 VM)上的笔记本服务器,但不能连接到 Python 内核。

我从最新的 Anaconda 发行版开始。我可以通过网络从我的本地机器连接到笔记本服务器,浏览 VM 的目录树,并创建新的笔记本,但永远无法连接到内核(Jupyter 右上角的橙色消息)。笔记本端口(8888)在防火墙设置中打开。 iPython 笔记本 returns 以下:

[I 19:21:10.152 NotebookApp] Using MathJax from CDN: https://cdn.mathjax.org/mathjax/latest/MathJax.js
[I 19:21:10.169 NotebookApp] Serving notebooks from local directory: /home/rattlerray
[I 19:21:10.170 NotebookApp] 0 active kernels 
[I 19:21:10.170 NotebookApp] The IPython Notebook is running at: https://[all ip addresses on your system]:8888/
[I 19:21:10.170 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 19:22:13.835 NotebookApp] 302 GET / (98.169.96.157) 0.85ms
[I 19:22:31.902 NotebookApp] Creating new notebook in 
[I 19:22:33.634 NotebookApp] Kernel started: 011d8a15-0e4a-448a-b02a-4121780e4bb6

如果有人 运行 以前参与过这个并且可以提供一些东西来检查,我将不胜感激。谷歌搜索没有帮助,我真的很想让它在云上运行。谢谢!

我正在使用 EC2 但遇到同样的问题。

我使用 tutorial 中告知的 SSL,登录并在 Safari 中打开笔记本后始终显示 "Connecting to kernel"。然后我尝试 Chrome,它会发出有关证书的警告,但工作正常。

然后我在配置文件中注释证书,然后在 Safari 中打开它工作正常。

如果您使用的是Firefox,可能是这个问题Unable to contact kernel in Firefox after updating to ipython 3.0

希望这会有所帮助。

更新: 该问题已在 Github 上报告:https://github.com/ipython/ipython/issues/8621. As said in the post, this is the limitation of Safari. If you still want to use SSL to visit Notebook, you have to add the certificate into your keychain and trust it. Check the help posted by Apple: https://support.apple.com/kb/PH18677?locale=en_US

连接到 IPython (Jupyter) Notebook 服务器的另一种方法是打开带有端口转发的 SSH 隧道。我写了一个方法 post 来描述我自己的工作流程。我在 Chrome 中使用 Google Compute Engine,但许多步骤类似于其他设置变体:
https://stharrold.github.io/20151208-ipynb-on-gce-from-chrome.html

摘录:
"""
简要设置例程:
* 启动 [您的] 虚拟机实例。
* 在实例上启动 Jupyter Notebook 服务器:
$ jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser &
$ disown 1234(其中 1234 是进程 ID)
* 创建一个 SSH tunnel 以将本地端口转发到实例上的服务器端口:
$ ssh -f -N -L localhost:8888:0.0.0.0:8888 samuel_harrold@123.123.123.123
对于 [the] Chrome [app] Secure Shell,省略 -f 以保持隧道打开(参见屏幕截图 [in post])。
* 在 http://localhost:8888
查看服务器 """

其他详细信息在 post。