当前位置:网站首页>Change Jupyter Notebook default open directory

Change Jupyter Notebook default open directory

2022-08-09 07:04:00 Anakin6174

Jupyter notebook is an interactive editor under anaconda, which is very convenient and easy to use.
By default, the opened directory is the user directory, and many other files are also stored in this directory, which is confusing. We can set a separate directory by ourselves.
When using the anaconda2 version before, you can directly modify the configuration file:
There is a jupyter_notebook_config.py file in the C:\Users\username.jupyter directory, edit the c.NotebookApp.notebook_dir in this file and remove the frontThe # (represents a comment), followed by the directory you want to specify;
For example: c.NotebookApp.notebook_dir = 'E:/PythonProjects/JupyterNotebook/'
Then save the file and restart jupyter notebook.

But in the anaconda3 version, just modifying this configuration file does not work, and you have to modify the properties of jupyte:
1. The right-click properties modify the starting position of the shortcut, and it is found that the default path cannot be modified.
2. Later, I found that there is a parameter %USERPROFILE% behind the "target", which obviously determines the directory, so I deleted this parameter and changed it to "specified directory", and then it's ok, remember to bring double quotation marks.That is, the path of the target and the starting position is the same, and the parameter %USERPROFILE% after the target must be replaced!!!
insert image description here

Reference articles:

1 https://blog.csdn.net/yukinoai/article/details/83087221
2 https://blog.csdn.net/yukinoai/article/details/83087221
3 https://www.cnblogs.com/zwt20120701/p/11253297.html

原网站

版权声明
本文为[Anakin6174]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/221/202208090655474373.html