SoFunction
Updated on 2024-11-17

Jupyter notebook changes the default path to open files.

Jupyter notebook Changing the default path for file opening

Step 1: Modify the icon

- Find the Jupyter notebook desktop icon

桌面图标

- Right-click on the Jupyter notebook desktop icon and click Properties.

- Find %USERPROFILE% and delete it (just delete it, don't change anything else)

删除部分路径信息

- Remove %USERPROFILE% and leave the rest as default, don't change it.

删除路径信息之后

Step 2: Generate Configuration File

- The windows key + R brings up the Run window

命令行窗口 

- Type cmd in the Run window to open a command line window.

输入 cmd 打开命令行

- Type jupyter notebook --generate-config and hit enter.

输入命令

- This generates a file

文件路径信息

Step 3: Modify the configuration file

- Open configuration file

打开配置文件

- Find #.notebook_dir = '' and modify it

修改配置信息

- ctrl + s to save changes to this file is sufficient. (The file with your path information needs to be created in advance)

提前创建好文件

Step 4: Open Jupyter notebook

- Double-click the Jupyter notebook desktop icon.

桌面图标

- Run window pops up

在这里插入图片描述

- The page opens normally, but the path has been changed

在这里插入图片描述

be highly successful

Supplement:

Some of you have encountered that after starting jupyter notebook, the program just starts the command line, but does not automatically display the web page in a pop-up window, which is quite a headache.

I have another blog for you here as well.

It is used to solve the problem of launching jupyter notebook without automatically popping up the page.The portal is here.

The above is a personal experience, I hope it can give you a reference, and I hope you can support me more.