使用 `ipython` 指定的调用 pyspark 会导致启动 jupyter notebook

Invoking pyspark with `ipython` specified results in jupyter notebook being launched

我更喜欢使用 ipython 增强的 REPL 而不是 python,因此我在 pyspark 命令行中这样指定:

结果jupyter notebook 启动(令人惊讶):

 PYSPARK_DRIVER_PYTHON=ipython MASTER="local[*]" $SPARK_HOME/bin/pyspark

这种方法已经工作了几年 - 但目前它正在导致 jupyter notebook 启动。

如果显式命令 notebook 也存在,该结果将有意义:

结果jupyter notebook 启动(预期):

 PYSPARK_DRIVER_PYTHON=ipython notebook MASTER="local[*]" $SPARK_HOME/bin/pyspark

鉴于 notebook 未指定 那么为什么启动笔记本而不是 REPL

注意:当通过

在命令行中单独使用ipython

结果ipython REPL 启动(预期):

    ipython

REPL 已启动 (而不是 jupyter notebook)。

您可能已将 PYSPARK_DRIVER_PYTHON_OPTS 变量设置为 "notebook"。这将导致打开 jupyter notebook