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)
and enter the following command
jupyter notebook --generate-config --allow-root
Open the jupyter_notebook_config configuration file at the file address in the underscore
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.
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.
2 Modify the default browser
Or open the jupyter_notebook_config configuration file
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.
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.
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