IPython笔记本不会读取配置文件

IPython notebook won't read the configuration file

我使用以下命令初始化配置文件:

ipython profile create myserver

将这些行添加到 ~/.ipython/profile_myserver/ipython_notebook_config.py:

c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.port = 8889

尝试启动笔记本:

ipython notebook --profile=myserver --debug

它根本不读取配置文件。 这是日志输出:

[W 16:26:56.607 NotebookApp] Unrecognized alias: '--profile=myserver', it will probably have no effect.
[D 16:26:56.609 NotebookApp] Config changed:
[D 16:26:56.609 NotebookApp] {'profile': u'myserver', 'NotebookApp': {'log_level': 10}}
...
[I 16:26:56.665 NotebookApp] 0 active kernels 
[I 16:26:56.665 NotebookApp] The IPython Notebook is running at: http://localhost:8888/

由于我已经明确指定了端口 8889 而它仍然在 8888 上运行,因此它显然会忽略配置文件。我错过了什么?

不使用 ipython 命令,而是使用 jupyter:

jupyter notebook --profile=myserver

在这些链接上有 the release of IPython 4.0, the language-agnostic pieces of IPython, such as the notebook server, were moved to Jupyter. You can read more about The Big Split and the new release of Jupyter

IPython 现在已经移动到 version 4.0,这意味着如果您正在使用它,它将从 [=11= 读取其配置],而不是 ~/.ipython。您必须使用

创建一个新的配置文件
jupyter notebook --generate-config

然后根据需要编辑生成的 ~/.jupyter/jupyter_notebook_config.py 文件。

更多安装说明here