Jupyter Notebook does not automatically open the browser

Installed Winpython , run Jupyter Notebook.exeor Jupyter lab.exealways not automatically open the browser, suggesting that "no web browser found"

A Solution

  1. open a filesettings\.jupyter\jupyter_notebook_config.py
  2. search forwebbrowser
  3. Remove the c.NotebookApp.browser = ''front #, and the read line
    c.NotebookApp.browser = u'D:/ProgramFiles/Browsers/Chrome75/MyChrome.exe %s'
  4. Save changes.
  5. Running Jupyter Notebook.exeor Jupyter lab.exealready automatically open the browser.

Solution two

  1. In the solution [A] a third step, add the following code

    #import webbrowser
    webbrowser.register("Chrome",None,webbrowser.GenericBrowser(u'D:/ProgramFiles/Browsers/Chrome75/MyChrome.exe))
    c.NotebookApp.browser = 'Chrome'
  2. Save changes

note

  • The above D:/ProgramFiles/Browsers/Chrome75/is chrome installation directory, I used Mychorm green.
  • If you do not jupyter_notebook_config.py, you can run jupyter notebook --generate-config, it will automatically generate configuration files.

Guess you like

Origin www.cnblogs.com/ourweiguan/p/11520151.html