|||
1 永久更改Jupyter notebook默认目录路径
1) 创建Jupyter notebook的配置文件jupyter_notebook_config.py,在终端中输入:
\$ jupyter notebook --generate-config
2) 打开jupyter_notebook_config.py,找到如下文字:
## The default URL to redirect to from `/`
#c.NotebookApp.default_url = '/tree'
将其修改为:
## The default URL to redirect to from `/`
c.NotebookApp.default_url = '/tree/Coding'
此时,Jupyter notebook的默认目录路径就变成了/home/Coding, 即Users/yliu/Coding
注:该方法只能通过home目录启动Jupyter notebook,从其他目录启动会出现Jupyter notebook网页无法显示的状态。即启动方式如下(终端):
\$ yliu-16:52:26:~\$ ipython notebook
而不能是: \$ yliu-16:53:53:Coding\$ ipython notebook
2 单次更改Jupyter notebook默认目录路径
1)在终端中cd到目标目录:
cd ~/Coding
2) \$ yliu-16:53:53:Coding\$ ipython notebook
注:该方法的前提是不对Jupyter notebook的配置文件jupyter_notebook_config.py
做任何更改。
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-23 21:06
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社