ipython/jupyter notebook修改文件存储路径和浏览器

版权声明:提倡知识共享,可以转载和使用 https://blog.csdn.net/Mr_Cat123/article/details/82377556

第一部分:文件保存路径

首先要有配置文件,鉴于有些在/.jupyter下没有config文件,所以要先生成:
在cmd终端生成配置文件,输入(如果终端没有设置环境变量则在Anaconda的anaconda prompt里面):

jupyter notebook --generate-config

然后进入/.jupyter里(如C:\Users\wudl.jupyter),找到jupyternotebook_config.py;将dir处改为自己想保存的地址(记住将前面的#号去掉)

c.NotebookApp.notebook_dir = u'F:\\jupyternotebookfile'

上面的方法同样适合linux

jupyter notebook --generate-config
vim ~/.jupyter/jupyter_notebook_config.py

找到c.NotebookApp.notebook_dir去掉前面的#号,填入路径,如

c.NotebookApp.notebook_dir = u'/home/wudl/inotebook'

第二部分:换浏览器

同样是打开上面的文件,在brower那栏添加如下,并将brower前的#号去掉,在‘ ’填上自己喜欢的浏览器的地址,如下

import webbrowser
webbrowser.register("chrome", None, webbrowser.GenericBrowser(u"E:\\360software\\360Chrome\\Chrome\\Application\\360chrome.exe"))
c.NotebookApp.browser = 'chrome'

猜你喜欢

转载自blog.csdn.net/Mr_Cat123/article/details/82377556