1、打开cmd
2、输入:
jupyter lab --generate-config
显示jupyter_lab_config.py所在路径
C:\XX\XX\XX\jupyter_lab_config.py
3、修改jupyter_lab_config.py
记事本打开jupyter_lab_config.py
Ctrl+F,搜索:the directory to use
## The directory to use for notebooks and kernels.
# Default: ''
# c.ServerApp.root_dir = ''
在# c.ServerApp.root_dir = ’ '代码下添加代码
## The directory to use for notebooks and kernels.
# Default: ''
# c.ServerApp.root_dir = ''
c.ServerApp.root_dir = '你希望的Jupyterlab默认工作路径'
保存jupyter_lab_config.py文件
4、重启jupyter lab