Jupyter Notebook change the document path and browser settings

created at 06-27-2021 views: 5

Jupyter Notebook modify the document path and browser settings
I thought there was a lot of such content on the Internet, but I found too many errors in a search, so I simply wrote one for my own installation and debugging later.

The process of installing Anconda in the first step is no longer said.

1. After installation, open the prompt under the start menu

Further input jupyter notebook --generate-config, find the path of the jupyter_notebook_config file, usually C:\Users\Administrator\.jupyter. According to some articles on the Internet, an error will be reported when the CMD command is executed under the D disk installation file.

2. Open the jupyter notebook --generate-config file

change file path

Find c.NotebookApp.notebook_dir, remove the # sign, and modify it to the target location you want to specify. Mine is as follows:
c.NotebookApp.notebook_dir ='F:\\Jupyter'

Modify browser settings
Find c.NotebookApp.browser ='' Chorme was installed by default at the time, so it is usually on the C drive. If you have modified it, you need to find the location of the chrome.exe file.

My configurations are as follows:

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

Note that there is a space in the Program Files. If you make a mistake, you may not be able to open the browser.

Please log in to leave a comment.