[Solved] The problem that Jupyter notebook cannot jump to the webpage (pro-tested successfully)

Problem Description

        After anaconda, there is a Jupyter notebook in it, which is very convenient for programming visualization. However, when some friends use Jupyter-notebook to start from the command line, the browser does not automatically jump, and the following interface appears:     


Cause Analysis

The reason may be that there are too many browsers in the system, let’s set it up to solve this problem


solution:

(1) Open the anaconda command line, enter the following command in the window (or enter the virtual environment)

jupyter notebook --generate-config

   (2) After inputting, you can see that a configuration file named upyter_notebook_config.py has been generated, copy the path

 (3) Open the file after copying the path. Pull to the end and enter the following code:

import webbrowser
webbrowser.register('chrome',None, webbrowser.GenericBrowser(u'C://Program Files (x86)//Google//Chrome//Application//chrome.exe'))
c.NotebookApp.browser ='chrome'

        It is recommended to use Google Chrome, and the path on the second line of the above code should be modified and filled in according to the location of your browser.

The chrome query path can be copied         from the beginning and replace the \ of the path with // (double backslash) . The path on the second line of the above code is fine. Note: The copied address needs to change \ to //.

 (4) Save and exit. Re-open jupyter notebook and you can see that it can be opened.

Guess you like

Origin blog.csdn.net/m0_57787115/article/details/129392443