停止 ipython 查看 ~/.ipython

Stop ipython from looking in ~/.ipython

我用这个命令行启动我的笔记本:

ipython3 notebook --profile=/ipython3/profiles/qa-ipython3/ipython_config.py \
                  --ip=0.0.0.0                                               \
                  --port=80                                                  \
                  --no-browser                                               \
                  --notebook-dir=/ipython3/notebooks                         \
                  --ipython-dir=/ipython3/ipython                            \
                  --profile-dir=/ipython3/profiles

如果我删除 $HOME/.ipython,我从 ipython 得到一个例外:

FileNotFoundError: [Errno 2] No such file or directory: '/root/.ipython'

我需要做什么才能让 ipython3 notebook 将自己限制为仅 /ipython3/...

要IPython查看其配置文件的自定义目录,可以使用IPYTHONDIR环境变量。

在 Win7 上,我使用启动条,它在启动笔记本之前设置变量,以便在不同的配置文件和 IPython 版本之间快速切换,例如

set IPYTHONDIR=PATH/TO/DIR/.ipython
ipython notebook

同样适用于类 unix 系统。
当然,这并没有指定从哪里提供笔记本,而只是设置了配置文件目录。