当前位置: 移动技术网 > IT编程>脚本编程>Python > 更改 jupyter notebook 的默认打开路径

更改 jupyter notebook 的默认打开路径

2020年08月10日  | 移动技术网IT编程  | 我要评论
更改 jupyter notebook 的默认目录 ---- 小记一下

更改 jupyter notebook 的默认目录 ---- 小记一下

我用的是 Anaconda3

第一步
在开始菜单中打开 Anaconda Prompt (Anaconda3),在里面输入如下语句:
jupyter notebook --generate-config
在这里插入图片描述

第二步
在默认的路径下找到 jupyter_notebook_config.py 的文件,我的默认目录是 C盘
在这里插入图片描述

第三步
右击 用记事本 打开 jupyter_notebook_config.py。然后,点 编辑 下面的 查找,输入 # The directory to use for notebooks and kernels. ,查找下一个。
在这里插入图片描述
在这里插入图片描述

第四步
首先,删除 #c.NotebookApp.notebook_dir = ‘’ 前面的 #;
然后,在单引号中输入你要保存的路径,我的是 D:\\jupyter_project
是两个斜线 \\ !!
在这里插入图片描述

第五步
我创建了 jupyter notebook 的桌面快捷方式,所以直接在桌面右击 jupyter notebook 的快捷方式 ,找到属性。然后,将“目标”原来的 “%USERPROFILE%/” 中的 %USERPROFILE%,改成自己的目标位置可以了,我写的是 “D:\jupyter_project/”。
注意了,起始位置也得改成这个哦!

注意:任何一个符号都不错哦!
在这里插入图片描述

第六步
重启 jupyter notebook ,就可以看到我的 jupyter notebook 打开的路径 就是 我之前改的路径,如下所示。
在这里插入图片描述
在这里插入图片描述

参考连接:
https://www.zhihu.com/question/31600197
https://blog.csdn.net/Late_whale/article/details/103755127
https://blog.csdn.net/sinat_34328764/article/details/82949498
https://zhuanlan.zhihu.com/p/34337292

完成! 开心!

自学Python和深度学习,初学者,加油!

本文地址:https://blog.csdn.net/Carol_5/article/details/107882972

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网