- SPARK_SUBMIT_OPTIONS中的文件在zeppelin

时间:2017-02-03 10:08:50

标签: pyspark apache-zeppelin

我有一个python包,其中包含许多内置在.egg文件中的模块,我想在zeppelin笔记本中使用它。根据zeppelin文档,要将此包传递给zeppelin spark解释器,您可以通过conf / zeppelin-env.sh中SPARK_SUBMIT_OPTIONS中的--files选项将其导出。

当我通过SPARK_SUBMIT_OPTIONS中的--files选项添加.egg时,zeppelin笔记本不会抛出错误,但我无法在zeppelin笔记本中导入该模块。

传递.egg文件zeppelin spark intrepreter的正确方法是什么?

Spark版本为1.6.2,zeppelin版本为0.6.0

zepplein-env.sh文件包含以下内容:

export SPARK_HOME=/home/me/spark-1.6.1-bin-hadoop2.6
export SPARK_SUBMIT_OPTIONS="--jars /home/me/spark-csv-1.5.0-s_2.10.jar,/home/me/commons-csv-1.4.jar --files /home/me/models/Churn-zeppelin/package/build/dist/fly_libs-1.1-py2.7.egg"

1 个答案:

答案 0 :(得分:0)

You also need to adjust the PYTHONPATH on the executor nodes:

export SPARK_SUBMIT_OPTIONS="... --conf 'spark.executorEnv.PYTHONPATH=fly_libs-1.1-py2.7.egg:pyspark.zip:py4j-0.10.3-src.zip' ..."

It does not seem to be possible to append to an existing python path, therefore make sure you list all the required dependencies.