为啥 python 解释器不能在 Zeppelin 0.8.0 上为我的任何笔记本工作?

Posted

技术标签:

【中文标题】为啥 python 解释器不能在 Zeppelin 0.8.0 上为我的任何笔记本工作?【英文标题】:Why is python interpreter not working on Zeppelin 0.8.0 for any of my notebooks?为什么 python 解释器不能在 Zeppelin 0.8.0 上为我的任何笔记本工作? 【发布时间】:2019-11-28 12:23:18 【问题描述】:

我只是输入:

%python

print ("hi") 

但每次我为我的任何笔记本运行它时,它都会显示以下错误:

java.lang.OutOfMemoryError:Java 堆空间位于 org.apache.thrift.protocol.TBinaryProtocol.readStringBody(TBinaryProtocol.java:379) 在 org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:230) 在 org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69) 在 org.apache.zeppelin.interpreter.thrift.RemoteInterpreterService$Client.recv_createInterpreter(RemoteInterpreterService.java:209) 在 org.apache.zeppelin.interpreter.thrift.RemoteInterpreterService$Client.createInterpreter(RemoteInterpreterService.java:192) 在 org.apache.zeppelin.interpreter.remote.RemoteInterpreter$2.call(RemoteInterpreter.java:169) 在 org.apache.zeppelin.interpreter.remote.RemoteInterpreter$2.call(RemoteInterpreter.java:165) 在 org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess.callRemoteFunction(RemoteInterpreterProcess.java:135) 在 org.apache.zeppelin.interpreter.remote.RemoteInterpreter.internal_create(RemoteInterpreter.java:165) 在 org.apache.zeppelin.interpreter.remote.RemoteInterpreter.open(RemoteInterpreter.java:132) 在 org.apache.zeppelin.interpreter.remote.RemoteInterpreter.getFormType(RemoteInterpreter.java:299) 在 org.apache.zeppelin.notebook.Paragraph.jobRun(Paragraph.java:407) 在 org.apache.zeppelin.scheduler.Job.run(Job.java:188) 在 org.apache.zeppelin.scheduler.RemoteScheduler$JobRunner.run(RemoteScheduler.java:307) 在 java.util.concurrent.Executors$RunnableAdapter.call(未知来源) 在 java.util.concurrent.FutureTask.run(Unknown Source) 在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(未知 来源)在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(未知 来源)在 java.util.concurrent.ThreadPoolExecutor.runWorker(未知 来源)在 java.util.concurrent.ThreadPoolExecutor$Worker.run(未知 来源)在 java.lang.Thread.run(未知来源)

我正在尝试在 Zeppelin 上的笔记本上使用 python。我将 java 和 python 路径都添加到了我的环境变量中,并且我也安装了库 py4j。此外,我已将我正在使用的本地主机添加到 Zeppelin-site.xml 文件中。我还在 Stack Overflow 上的类似问题上找到了此链接,并尝试了其中的所有内容来更改 java 空间的大小,但仍然没有用。 http://apache-zeppelin-users-incubating-mailing-list.75479.x6.nabble.com/Can-not-configure-driver-memory-size-td1513.html

非常感谢任何一点帮助!

【问题讨论】:

【参考方案1】:

通过使用全新下载的 Zeppelin,我能够克服上述错误。但是,在尝试使用 python 解释器时,我确实遇到了另一个问题: Apache Zeppelin 8.1 Win10 Python Interpreter Error

用于启动 Zeppelin 的 cmd 窗口中的堆栈跟踪显示以下错误: Apache Zeppelin 8.1 Win10 Python Interpreter Error Stack Trace

基本上通过引用代码,我能够看到 python 解释器正在尝试创建一个临时文件并放入一个名为 tmp 的文件夹中: https://github.com/apache/zeppelin/blob/branch-0.8/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java,第 102 行

从这一点开始,我不确定它在哪里尝试使用名为 tmp 的文件夹。在我的 PC 上,该位置最终位于 C 的根目录中,因此 C:\tmp

【讨论】:

以上是关于为啥 python 解释器不能在 Zeppelin 0.8.0 上为我的任何笔记本工作?的主要内容,如果未能解决你的问题,请参考以下文章

如何通过 python 解释器在 Apache Zeppelin 上使用凭证注入

Windows 上的 Apache Zeppelin:创建 python 解释器时出错

使用python在zeppelin中动态选择表单

如何在 HDP 中的 zeppelin-spark2 中将库安装到 python

apache zeppelin入门

「大数据系列」:Apache zeppelin 多目标笔记本