5

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

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

[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

如果有人以前遇到过这个问题并且可以提供一些东西来检查,我会很感激的。谷歌搜索没有帮助,我真的很想让这个在云上工作。谢谢!

4

2 回答 2

9

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

我使用教程中介绍的 SSL ,登录后在 Safari 中打开一个笔记本,总是显示“连接到内核”。然后我尝试使用 Chrome,它会发出有关证书的警告,但工作正常。

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

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

希望这会有所帮助。

更新:Github 上报告了该问题:https ://github.com/ipython/ipython/issues/8621 。正如帖子中所说,这是 Safari 的限制。如果您仍想使用 SSL 访问 Notebook,则必须将证书添加到您的钥匙串中并信任它。查看 Apple 发布的帮助:https: //support.apple.com/kb/PH18677?locale=en_US

于 2015-08-03T00:34:15.980 回答
1

连接到 IPython (Jupyter) Notebook 服务器的另一种方法是打开带有端口转发的 SSH 隧道。我写了一篇关于我自己工作流程的操作指南。我在 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 隧道以将本地端口转发到服务器的端口在实例上:
$ 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

其他详细信息在帖子中。

于 2015-12-08T14:13:41.113 回答