如何使用PySpark加载IPython Shell [英] How to load IPython shell with PySpark
问题描述
我想加载IPython Shell(不是IPython Notebook),可以在其中通过命令行使用PySpark.那可能吗? 我已经安装了Spark-1.4.1.
I want to load IPython shell (not IPython notebook) in which I can use PySpark through command line. Is that possible? I have installed Spark-1.4.1.
推荐答案
如果使用Spark< 1.2您可以简单地使用环境变量IPYTHON=1
执行bin/pyspark
.
If you use Spark < 1.2 you can simply execute bin/pyspark
with an environmental variable IPYTHON=1
.
IPYTHON=1 /path/to/bin/pyspark
或
export IPYTHON=1
/path/to/bin/pyspark
虽然上述内容仍可在Spark 1.2及以上版本上使用,但为这些版本设置Python环境的推荐方法为PYSPARK_DRIVER_PYTHON
While above will still work on the Spark 1.2 and above recommended way to set Python environment for these versions is PYSPARK_DRIVER_PYTHON
PYSPARK_DRIVER_PYTHON=ipython /path/to/bin/pyspark
或
export PYSPARK_DRIVER_PYTHON=ipython
/path/to/bin/pyspark
您可以将ipython
替换为您选择的解释器的路径.
You can replace ipython
with a path to the interpreter of your choice.
这篇关于如何使用PySpark加载IPython Shell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!