Install jpype in Mountain Lion

I am trying to install jpype in Mountain Lion. I followed all the steps suggested in this post: How to install JPype on OS X Lion for use with Neo4j?

However, there is a glitch with Mountain Lion. I changed the setupMacOSX() function as follows:

 /Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/JavaVM.framework/ 

But when I run $ sudo python setup.py install , I get the following error:

 src/native/common/include/jpype.h:45:10: fatal error: 'jni.h' file not found 

I found the jni.h header here:

 /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h 

But since jni.h is not part of Mountain Lion, I did not understand how to modify the setup.py file to fix the error. Any suggestions?

+6
source share
1 answer

This works on a system with OSX 10.8.5.

I changed setup.py for JPype-0.5.4.2 and added an item to the end of the self.includeDirs list that is created in the setupInclusion function. This function is declared on line 61 for this particular version of JPype.

  def setupInclusion(self): self.includeDirs = [ self.javaHome+"/include", self.javaHome+"/include/"+self.jdkInclude, "src/native/common/include", "src/native/python/include", #I added this line below. The folder contains a jni.h "/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/" ] 

Finally, I ran pip install ~/Path/To/JPype-folder/ and the installation was successful.

+9
source

Source: https://habr.com/ru/post/952797/


All Articles