【问题标题】:jpype startJVM crashes ipython notebookjpype startJVM 崩溃 ipython 笔记本
【发布时间】:2015-08-20 11:25:58
【问题描述】:

我正在尝试在 ipython 笔记本中使用 JPype 以使用 JIDT(我不懂 Java)。我按照这里的说明进行操作:https://code.google.com/p/information-dynamics-toolkit/wiki/PythonExamples

我导入 jpype 并使用以下命令启动 java 虚拟机:

from jpype import *
startJVM(getDefaultJVMPath())

这使得 ipython notebook 内核由于以下错误而崩溃:

python(490,0x7fff7a99e310) malloc: *** error for object 0x104d90720: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

但是,它在 ipython shell 中运行良好。

我如何知道错误来自何处以及如何解决?

我使用: OSX 10.9.5 Python 2.7.10,Anaconda 2.2.0,IPython 3.1.0

任何帮助将不胜感激。

【问题讨论】:

    标签: python-2.7 ipython ipython-notebook jpype


    【解决方案1】:

    我认为这与用于安装 JPype 的 C 编译器有关。尝试将 C 编译器设置为 clang 并像这样安装 JPype:

    $env CC=clang python setup.py install
    

    【讨论】:

    • 嗨,这可能是什么原因?我在 windows 环境下也有类似的情况。
    猜你喜欢
    • 2013-01-19
    • 2018-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-03
    • 1970-01-01
    • 1970-01-01
    • 2023-04-04
    相关资源
    最近更新 更多