【发布时间】:2019-09-09 09:19:38
【问题描述】:
所以我在尝试打开 jupyter 笔记本时没有问题,但由于某种原因,无论我尝试做什么,我都无法让它在浏览器中自动打开。我按照这些帖子无济于事: unable to open jupyter(ipython) notebook on browser https://github.com/jupyter/notebook/issues/2130
我通过jupyter notebook --generate-config 创建了jupyter 配置并修改了这些设置:
c.NotebookApp.browser = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'
c.NotebookApp.open_browser = True
c.NotebookApp.webbrowser_open_new = 2
它仍然没有在 Chrome 中自动打开笔记本。我想知道我是否在做一些愚蠢的事情,但我不知道还能做什么。我在 Windows 10 上运行并通过 cygwin 启动 jupyter。当我在 cygwin 中输入jupyter notebook(修改设置文件后)时,它给了我这个输出:
$ jupyter notebook
[I 21:57:41.782 NotebookApp] Serving notebooks from local directory: /cygdrive/c/home
[I 21:57:41.782 NotebookApp] The Jupyter Notebook is running at:
[I 21:57:41.782 NotebookApp] http://localhost:8888/?token=373da6a3a3ed7c5fb991f0b3b1042bff22e3fa946aea8bc1
[I 21:57:41.782 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 21:57:41.799 NotebookApp]
To access the notebook, open this file in a browser:
file:///cygdrive/c/home/.local/share/jupyter/runtime/nbserver-1003-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=373da6a3a3ed7c5fb991f0b3b1042bff22e3fa946aea8bc1
我还能做些什么让它在浏览器中自动打开吗?
更新:我找到了这个链接,但它也不起作用:Launch IPython notebook with selected browser
我也发现这个设置不对:c.NotebookApp.browser = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe',应该是:c.NotebookApp.browser = 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'。但我仍然没有任何进展。 :(
【问题讨论】:
-
我在 Windows 10 的 WSL 上也有类似的行为。Jupyter 没有打开笔记本启动,而是打开另一个页面 file:///home/user/.local/share/jupyter/runtime/nbserver -232-open.html .
-
临时破解可能会半自动启动浏览器:):
nohup jupyter lab & sleep 5; /mnt/c/Program\ Files\ \(x86\)/SeaMonkey/seamonkey.exegrep -om1 http.* nohup.out` ` -
嘿,感谢您的评论!我无法弄清楚我的问题,只是从头开始重新安装所有东西。我所说的一切,是指 Cygwin、python、我所有的库、依赖项以及我以前拥有的任何实用程序。我不知道以前的问题是什么,但是对我的 cygwin 和 python 安装进行简单的刷新解决了我所有的问题。如果您对此问题有任何其他建议,我们将不胜感激!
-
我找不到任何其他解决方案。最近一个相关问题here,问题可能与与windows的集成有关。
标签: python jupyter-notebook jupyter