我正在使用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
但我觉得自己很无助。救命啊!