【问题标题】:Cannot install JPype on ubuntu 12.04 64 bit无法在 ubuntu 12.04 64 位上安装 JPype
【发布时间】:2012-08-10 13:25:24
【问题描述】:

好吧,我按照here 的说明进行操作,但是在运行 setup.py 时出现编译错误

src/native/common/jp_voidtype.cpp: In member function ‘virtual void JPVoidType::setArrayValues(jarray, HostRef*)’:
src/native/common/jp_voidtype.cpp:105:2: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
In file included from src/native/python/jpype_python.cpp:18:0:
src/native/python/include/jpype_python.h:24:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

如您所见,我在前两行中收到了很多已弃用的警告(我没有发布),但随后出现了一个严重错误 - 缺少 Python.h 文件 - 导致安装失败。

我该如何修复它?我应该把这个文件放在哪里?

注意:我的 JAVA_HOME 正确设置为/usr/lib/jvm/java-7-oracle/

【问题讨论】:

  • 你是否正确安装了Python开发包?
  • 好吧,我没有。包裹的名称是什么?
  • 可能是python-dev 或类似的。
  • 好的,我现在做了,我根本没有得到 stderr 输出,但是当我导入 jpype 时仍然出现“没有名为 jpype 的模块”消息
  • 我也有这个问题,但是安装 python-dev 并没有为我解决。

标签: python installation jpype


【解决方案1】:

命令:

sudo apt-get install python-jpype

为我工作。

【讨论】:

    猜你喜欢
    • 2012-10-23
    • 1970-01-01
    • 2013-07-23
    • 1970-01-01
    • 2016-03-01
    • 2012-09-23
    • 2013-10-20
    • 2013-11-22
    • 2015-09-14
    相关资源
    最近更新 更多