如何使用PySpark加载IPython Shell [英] How to load IPython shell with PySpark

查看:162
本文介绍了如何使用PySpark加载IPython Shell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想加载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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆