问题
Jupyter-notebook doesn't open a web browser. It worked just fine before, then after windows 10 prompted for an update it began to open in Microsoft edge. When I tried to change it to the default browser which is chrome now it won't open at all.
I followed how to open Jupyter notebook in chrome on windows to try and change it back to chrome.
When I try and run
jupyter notebook
in cmd all I get is
[I 21:39:08.015 NotebookApp] JupyterLab extension loaded from C:\Users\roy\Anaconda3\lib\site-packages\jupyterlab
[I 21:39:08.015 NotebookApp] JupyterLab application directory is C:\Users\roy\Anaconda3\share\jupyter\lab
[I 21:39:08.015 NotebookApp] Serving notebooks from local directory: C:\Users\roy
[I 21:39:08.015 NotebookApp] The Jupyter Notebook is running at:
[I 21:39:08.015 NotebookApp] http://localhost:8888/?token=d0a958999d7e59da3f097809882e8f40eb5845e3a07cebe8
[I 21:39:08.031 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 21:39:08.109 NotebookApp] No web browser found: could not locate runnable browser.
To access the notebook, open this file in a browser:
file:///C:/Users/roy/AppData/Roaming/jupyter/runtime/nbserver-1516-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=d0a958999d7e59da3f097809882e8f40eb5845e3a07cebe8
However when I copy and paste the url in a web browser it just works fine.
回答1:
Solved it.
I went to the .jupyter folder in my Users directory > opened the jupyter_notebook_config.py file > then edited this line from c.NotebookApp.browser = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe ' to c.NotebookApp.browser = u'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
Now it works well.
回答2:
This solved my similar issue when jupyter is installed under my python 2.7 directory, but is not necessary under the jupyter installed in my python 3.7 directory. Readers with a 3.7 directory may be encountering a different issue.
来源:https://stackoverflow.com/questions/55554351/no-web-browser-found-could-not-locate-runnable-browser-jupyter-notebook