python - 无法在 ubuntu 12.04 64 位上安装 JPype

标签 python installation jpype

好吧,我按照说明做了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/

最佳答案

命令:

sudo apt-get install python-jpype

为我工作。

关于python - 无法在 ubuntu 12.04 64 位上安装 JPype,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11949160/

相关文章:

installation - 如何在一(或两)行命令中在 CentOS 7 上安装 libquicktime?

windows - 如何为我的 DirectShow 过滤器制作安装程序?

java - 在 Python 中实际使用 Java 类/JAR?

python - 有没有更快的方法从 scipy.sparse.dok_matrix 提取行/列子矩阵?

python - 创建余弦相似度矩阵 numpy

python : Logging : Removing StreamHandler

jpype - 当一个 JVM 已经启动时启动第二个 JVM 时出错

Python SQLAlchemy 模拟

C# WIX 卸载永久文件?

python - jpype._jclass.NoClassDefFoundError : edu/stanford/nlp/python/SUTimeWrapper