jupyter修改根目录

首先需要生成配置文件

PS C:Windowssystem32> jupyter lab --generate-config
Writing default config to: C:Usersxiyu.jupyterjupyter_notebook_config.py

然后修改配置文件
去除注释,并将其改为需要的路径

## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = 'D:\notebook'

实际上,jupyter notebook 生成的配置文件也是相同。

jupyter notebook --generate-config

但是,如果使用Jupyter Notebook (anaconda)这个快捷方式打开,则不会读取配置文件。

需要删除,快捷方式目标中的 "%USERPROFILE%" ,其的意思是使用用户的根目录作为jupyter的根目录。

原文地址:https://www.cnblogs.com/xiyu714/p/12084065.html