如何修改jupyter notebook默认打开目录

作者:你呵呵
链接:https://www.zhihu.com/question/31600197/answer/184693242
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

  • 首先如果使用anaconda直接安装jupyter notebook的话,直接在windows的cmd中输入jupyter notebook是没有用的,参见下图:
<img src="https://pic2.zhimg.com/50/v2-7c8832f53f4cce06fd3157eebee522e3_hd.jpg" data-rawwidth="596" data-rawheight="86" class="origin_image zh-lightbox-thumb" width="596" data-original="https://pic2.zhimg.com/v2-7c8832f53f4cce06fd3157eebee522e3_r.jpg">

原因可能是anaconda代理了所有它安装的软件,因此无法直接找到。

此时应该在anaconda prompt中直接输入jupyter notebook,就可以正常打开jupyter,适用于在cmd中输入jupyter notebook无效的各类操作,比如使用以下代码无效时。

jupyter notebook --generate-config
  • 使用修改配置文件的方法,再次打开jupyter notebook时,如果直接打开路径仍然没有改变,尝试使用anaconda prompt来打开。

  • 使用修改快捷方式的方法改变路径,我目前唯一实现的方法就是修改快捷方式标签的目标栏,如下图:
<img src="https://pic2.zhimg.com/50/v2-4f0f6a6746a732e286af87cc79a2f559_hd.jpg" data-rawwidth="679" data-rawheight="87" class="origin_image zh-lightbox-thumb" width="679" data-original="https://pic2.zhimg.com/v2-4f0f6a6746a732e286af87cc79a2f559_r.jpg">

将需要的路径放在引号和百分号之间,并且前后都有一个空格。本人win10,尝试过的其他方法,如直接将上图“目标”中的 %USERPROFILE%去掉、或者修改快捷方式标签下的起始位置等方法都无效。


修改这里没有效果。


  • 综上,答主两种方法测试有效:
  1. 修改配置文件,随后使用anaconda prompt启动jupyter notebook。
  2. 修改快捷方式,使用快捷方式直接启动

猜你喜欢

转载自blog.csdn.net/qq_35423500/article/details/79564363