【发布时间】:2020-12-13 18:55:03
【问题描述】:
我无法在 Jupyter 笔记本中导入以下内容。
findspark.init('home/ubuntu/spark-3.0.0-bin-hadoop3.2')
收到以下错误:
---------------------------------------------------------------------------
~/.local/lib/python3.6/site-packages/findspark.py in init(spark_home, python_path, edit_rc, edit_profile)
144 except IndexError:
145 raise Exception(
--> 146 "Unable to find py4j, your SPARK_HOME may not be configured correctly"
147 )
148 sys.path[:0] = [spark_python, py4j]
Exception: Unable to find py4j, your SPARK_HOME may not be configured correctly
我确实安装了 py4j,并且还尝试将以下这些行添加到 ~/.bashrc
export SPARK_HOME=/home/ubuntu/spark-3.0.0-bin-hadoop3.2
export PYTHONPATH=$SPARK_HOME/python/:$PYTHONPATH
export PYTHONPATH=$SPARK_HOME/python/lib/py4j-0.10.9-src.zip:$PYTHONPATH
【问题讨论】:
-
你尝试过其他版本的 spark 吗?
标签: python ubuntu pyspark py4j