jupyter notebook 修改默认目录

1.生成 jupyter notebook的 jupyter_notebook_config.py文件

 启动cmd,执行以下命令,查看 jupyter 配置文件路径

 运行下面的命令行,生成配置文件,若是以前有,则会让你选择是否覆盖。

jupyter notebook --generate-config

生成的文件默认存放在“C:\Users\Administrator\.jupyter”

2、修改 启动 jupyter botebook 后的默认路径

  找到配置文件 jupyter_notebook_config.py

       修改配置文件,找到以下语句

    ## The directory to use for notebooks and kernels. 
    #c.NotebookApp.notebook_dir = ''
 
    将其改为 
    ## The directory to use for notebooks and kernels. 
    c.NotebookApp.notebook_dir = 'G:\jupyterNotebook_DIR'
 

    标红的部分改成自己的目录 
  注意:

  1.#c.NotebookApp.notebook_dir = ''中的#必须删除,且前面不能留空格。 
  2.G:\jupyterNotebook_DIR文件夹必须提前新建,如果没有新建,Jupyter Notebook会找不到这个文件,会产生闪退现象。

猜你喜欢

转载自blog.csdn.net/chenguizhenaza/article/details/113676445