使用 ipython/jupyter 的配置文件

Using profiles with ipython/jupyter

这是 ipython 的帮助输出:

Examples

ipython notebook                       # start the notebook
ipython notebook --profile=sympy       # use the sympy profile
ipython notebook --certfile=mycert.pem # use SSL/TLS certificate

看起来很简单..但是当调用

$ipython notebook --profile=pyspark

出现以下警告:

[W 20:54:38.623 NotebookApp] Unrecognized alias: '--profile=pyspark', 
                            it will probably have no effect.

那么在线帮助与警告信息不一致。

激活配置文件的正确方法是什么?

更新 我试着颠倒顺序如下:

$ipython --profile=pyspark notebook

但随后出现不同的警告:

[TerminalIPythonApp] WARNING | File not found: u'notebook

在线文档不准确。顺序需要颠倒——在notebook:

之前加上--选项
$ipython --profile=pyspark notebook 

但是..问题甚至超出了..

似乎 jupyter(ipython 的较新版本)可能根本不尊重 ipython 配置文件。

有多个引用相同。这是 Spark 邮件列表中的一个

Does anyone have a pointer to Jupyter configuration with pyspark? The current material on python inotebook is out of date, and jupyter ignores ipython profiles.

该选项适用于 ipython 二进制文件,但您正试图将该选项传递给 notebook 应用程序,从来自 NotebookApp 的警告中可以明显看出:

[W 20:54:38.623 NotebookApp] Unrecognized alias: '--profile=pyspark', it will probably have no effect.

这基本上是说您正在将一个它无法识别的选项传递给 notebook,因此不会有任何效果。

您需要将选项传递给 ipython:

ipython --profile=foo -- notebook