Jupyter notebook startup path settings, modify the default browser and open a specified directory address

Jupyter notebook startup path settings, modify the default browser and open a specified directory address

1 start path setting

Select to open Anaconda Prompt (Anaconda3)
insert image description here
and enter the following command

jupyter notebook --generate-config --allow-root

insert image description here
Open the jupyter_notebook_config configuration file at the file address in the underscore

insert image description here
Press Ctrl+F to search for
c.NotebookApp.notebook_dir=''
and remove # in front, and enter the startup address you want to set in the quotation marks behind '', save and restart jupyter notebook.
insert image description here
It is found that there is still no jump to the set startup address.

Then right-click on Jupyter Notebook and select Properties. Just change the two red circles to the startup address you want to set, and the above address must use double quotation marks.
insert image description here
insert image description here
insert image description here

2 Modify the default browser

Or open the jupyter_notebook_config configuration file
insert image description here
Press Ctrl+F to search for
c.NotebookApp.browser
and remove # in front, enter the startup address you want to set in the quotation marks '' in the back, save and restart jupyter notebook.
For example, if you change to the chrome browser, right-click the chrome browser and select Properties.
insert image description here
insert image description here

import webbrowser
webbrowser.register("chrome",None,webbrowser.GenericBrowser(r"C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe"))
c.NotebookApp.browser = 'chrome'

Finally, save the configuration file and restart it, and it will be successful. Set other browsers to open by default, and you can draw inferences about other cases from one instance.
insert image description here

3 Open a specified directory address

After going to the specified directory first, hold down the shift key and right-click on the blank space, select to open the powershell window here, and finally enter the command:

jupyter notebook

You can open jupyter notebook in the current directory
insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/sunsoldeir1/article/details/128451247