gpt4 book ai didi

python - 将 `SPARK_HOME` 设置为什么?

转载 作者:IT老高 更新时间:2023-10-28 20:40:27 26 4
gpt4 key购买 nike

安装了 apache-maven-3.3.3,scala 2.11.6,然后运行:

$ git clone git://github.com/apache/spark.git -b branch-1.4
$ cd spark
$ build/mvn -DskipTests clean package

最后:

$ git clone https://github.com/apache/incubator-zeppelin
$ cd incubator-zeppelin/
$ mvn install -DskipTests

然后运行服务器:

$ bin/zeppelin-daemon.sh start

运行一个以 %pyspark 开头的简单笔记本时,我收到一个关于找不到 py4j 的错误。刚刚pip install py4j (ref)。

现在我收到此错误:

pyspark is not responding Traceback (most recent call last):
File "/tmp/zeppelin_pyspark.py", line 22, in <module>
from pyspark.conf import SparkConf
ImportError: No module named pyspark.conf

我尝试将我的 SPARK_HOME 设置为:/spark/python:/spark/python/lib。没有变化。

最佳答案

需要两个环境变量:

SPARK_HOME=/spark
PYTHONPATH=$SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-VERSION-src.zip:$PYTHONPATH

关于python - 将 `SPARK_HOME` 设置为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30824818/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com