当使用%spark.pyspark解释器时,得到错误:
org.apache.zeppelin.interpreter.InterpreterException: org.apache.zeppelin.interpreter.InterpreterException: Fail to bootstrap pyspark
at org.apache.zeppelin.interpreter.LazyOpenInterpreter.open(LazyOpenInterpreter.java:76)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:844)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:752)
at org.apache.zeppelin.scheduler.Job.run(Job.java:172)
at org.apache.zeppelin.scheduler.AbstractScheduler.runJob(AbstractScheduler.java:132)
at org.apache.zeppelin.scheduler.FIFOScheduler.lambda$runJobInScheduler$0(FIFOScheduler.java:42)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.zeppelin.interpreter.InterpreterException: Fail to bootstrap pyspark
at org.apache.zeppelin.spark.PySparkInterpreter.open(PySparkInterpreter.java:105)
at org.apache.zeppelin.interpreter.LazyOpenInterpreter.open(LazyOpenInterpreter.java:70)
... 8 more
Caused by: java.io.IOException: Fail to run bootstrap script: python/zeppelin_pyspark.py
Fail to execute line 54: sqlc = __zSqlc__ = __zSpark__._wrapped
Traceback (most recent call last):
File "/tmp/hadoop-root/nm-local-dir/usercache/root/appcache/application_1680782064460_0001/container_1680782064460_0001_01_000001/tmp/python16531023262914108461/zeppelin_python.py", line 162, in <module>
exec(code, _zcUserQueryNameSpace)
File "<stdin>", line 54, in <module>
AttributeError: 'SparkSession' object has no attribute '_wrapped'
at org.apache.zeppelin.python.PythonInterpreter.bootstrapInterpreter(PythonInterpreter.java:579)
at org.apache.zeppelin.spark.PySparkInterpreter.open(PySparkInterpreter.java:102)
... 9 more
齐柏林飞艇版本:0.10.1
Spark版本:3.3.0
测试了ipython,zeppelin外的pyspark,工作正常。
1条答案
按热度按时间vuktfyat1#
如果PySpark解释器的bootstrap脚本有问题,则会出现Zeppelin中的错误
java.io.IOException: Fail to run bootstrap script: python/zeppelin_pyspark.py
。bootstrap.py脚本负责为PySpark解释器设置Python环境,如果脚本中有错误,解释器将无法启动。以下是一些可以尝试的解决方案:
查看PySpark版本:确保您使用的是与Zeppelin兼容的PySpark版本。在Zeppelin解释器设置中检查PySpark版本,并确保它与您安装的PySpark版本匹配。
查看Python版本:请确保您安装了兼容的Python版本。PySpark可能与某些版本的Python存在兼容性问题,因此检查您使用的版本是否受支持非常重要。
仅供参考
Zeppelin版本0.10.1于2020年12月发布,兼容以下版本的PySpark和Python:
PySpark 2.4.7和3.0.1 Python 2.7、3.6和3.8