Cannot install JPype on ubuntu 12.04 64 bit

百般思念 提交于 2019-12-11 06:16:24

问题


Well, I followed the instructions here, but I get a compilation error when running 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

So as you can see I get a lot of deprecated warning (that I didn't post) like in the first two lines, but then there's a critical error - the missing Python.h file - that makes the installation fail.

How do I go about fixing it? Where should I put this file?

Note: my JAVA_HOME is set correctly to /usr/lib/jvm/java-7-oracle/


回答1:


The command:

sudo apt-get install python-jpype

Worked for me.



来源:https://stackoverflow.com/questions/11949160/cannot-install-jpype-on-ubuntu-12-04-64-bit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!