如何修改Jupyter Notebook 或者Jupyter Lab的默认启动目录?

如何修改Jupyter Notebook 或者Jupyter Lab的默认启动目录?

  1. 打开Anaconda
  2. 在命令行中输入:conda activate env(你自己的环境名称)
  3. jupyter Lab :在命令行中输入:jupyter-lab --generate-config
    (jupyter notebook 的命令类似为:jupyter notebook --generate-config
    在这里插入图片描述
  4. jupyter Lab :在用户目录(C:\Users\xx.jupyter)下生成一个名字jupyter_lab_config.py的文件。 jupyter Notebook :在用户目录(C:\Users\xx.jupyter)下生成一个名字jupyter_notebook_config.py的文件。

在这里插入图片描述
5.Jupyter Lab打开 jupyter_lab_config.py,找到第362行#c.ServerApp.notebook_dir = '',修改对应的打开路径,记得去掉前面的“#”
在这里插入图片描述
Jupyter Notebook打开jupyter_notebook_config.py,找到第362行#c.NotebookApp.notebook_dir = '',修改对应的打开路径,记得去掉前面的“#”
在这里插入图片描述

Guess you like

Origin blog.csdn.net/qq_43570025/article/details/118192587