Tag Archives: jupyter notebook Sets Default Browser Error

jupyter notebook Sets Default Browser Error: SyntaxError: (unicode error) ‘utf-8‘ codec can‘t decode byte 0xd4

Jupiter notebook sets the default browser to open with an error
syntax error: (Unicode error) ‘UTF-8’ codec can’t decode byte 0xd4 in position 0: invalid continuation byte

The default code of the Notepad provided by the win system is ANSI. Just reopen the PY script in the notebook,
save it as a py script coded as UTF-8, and it’s OK to run the PY script.

Modify the name of the file: jupyter_notebook_config.py

Code reference

import webbrowser 
webbrowser.register( "Cent Browser", None, webbrowser.GenericBrowser(r"C:\Users\中文用户名\AppData\Local\CentBrowser\Application\chrome.exe"))
c.NotebookApp.browser = "Cent Browser"

Set default browser, CMD input

jupyter notebook --generate-config

Find the PY file of the default configuration file
open it with notepad and find this statement: # c.NotebookApp.browser =
at the bottom of this statement, enter the following statement: the following figure is the configuration of chrome, * * pay attention to double \\**

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