2

我正在使用 Windows Bash。我试图运行jupyter notebook命令。它没有为我打开浏览器。但它告诉我:

[I 16:19:44.425 NotebookApp] Serving notebooks from local directory: /home/Dida
[I 16:19:44.425 NotebookApp] 0 active kernels
[I 16:19:44.427 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=056d3c3335bef80c2ae4a2e9c70bc8a62ea7c2bd0f1cc075
[I 16:19:44.431 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 16:19:44.433 NotebookApp] No web browser found: could not locate runnable browser.
[C 16:19:44.433 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=056d3c3335bef80c2ae4a2e9c70bc8a62ea7c2bd0f1cc075

好吧,我复制/粘贴没有任何问题http://localhost:8888/?token=...。一切都很好。我可以使用 Jupyter。但在我的梦想中,我希望 jupyter 自己打开浏览器(每次都不需要复制/粘贴)。

因此,我尝试运行 jupyter notebook --browser=chrome并使用此参数值。我尝试输入完整路径chrome.exe。但我倒霉。

在那之后,我很失望,python为了显示 Windows Bash 知道我做过的浏览器

>>> import webbrowser
>>> print(webbrowser._browsers)
{}

好吧,什么都没有!在那之后。我试图玩webbrowser图书馆。register, open, get- 命令。我总是得到这个:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/webbrowser.py", line 51, in get
    raise Error("could not locate runnable browser")
webbrowser.Error: could not locate runnable browser

但我觉得我很无助。帮助!

4

0 回答 0