因此,我在尝试打开 jupyter 笔记本时没有遇到问题,但由于某种原因,无论我尝试做什么,我都无法让它在浏览器中自动打开。我关注这些帖子没有效果:无法在浏览器上打开 jupyter(ipython) 笔记本 https://stackoverflow.com/questions/35398564/unable-to-open-jupyteripython-notebook-on-browser
https://github.com/jupyter/notebook/issues/2130 https://github.com/jupyter/notebook/issues/2130
我通过创建了 jupyter 配置jupyter notebook --generate-config
并修改了这些设置:
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。当我打字时jupyter notebook
(修改设置文件后)在 cygwin 中,它给了我这个输出:
$ 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
我还能做些什么让它在浏览器中自动打开吗?
更新:我找到了这个链接,但它也不起作用:使用选定的浏览器启动 IPython 笔记本 https://stackoverflow.com/questions/15632663/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'
。但我仍然没有取得任何进展。 :(