[Jepp-users] .JepException: <type 'exceptions.ImportError'> undefined symbol error
Brought to you by:
mrjohnson0
From: John P <joh...@gm...> - 2011-07-15 15:51:23
|
I know this sort of problem has been addressed in other threads but can't quite figure out how to get around it for my case. I can use jep to open a python module and run functions in that module. However, the entire reason that I'm using jep is to have access to numpy and scipy. When I try to import numpy or scipy from my python module I get this error: java -Djava.library.path=. -jar jeptest.jar Exception in thread "main" jep.JepException: <type 'exceptions.ImportError'>: /usr/lib/python2.6/dist-packages/numpy/core/multiarray.so: undefined symbol: _Py_ZeroStruct at jep.Jep.run(Native Method) at jep.Jep.runScript(Jep.java:191) at jep.Jep.runScript(Jep.java:167) at jeptest.runme$.main(jeptest.scala:17) at jeptest.runme.main(jeptest.scala) Here are the steps I've taken: fresh install of Ubuntu 11.04 installed (using apt-get install python-numpy python-scipy) both numpy and scipy (python2.6 was already loaded on the instance) apt-get install sun-java6-jdk export JAVA_HOME=/usr/lib/jvm/java-6-sun sudo apt-get install python2.6-dev downloaded jep-2.4.tar.gz ran autoconf/configure/make/make install copied my libjeb.so to the folder I was running the jar from Please note the " -Djava.library.path=." in my command-line call to java. As explained in http://jepp.sourceforge.net/usage.html#tomcat, I think I somehow also have to set LD_PRELOAD and LD_LIBRARY_PATH. But I have no clue what to set them to. In addition, I will be running this jar on a hadoop cluster, so I will have to programmatically set both those environmental variables. So my questions are: 1. Will setting LD_PRELOAD and LD_LIBRARY_PATH allow my python script to successfully import & use numpy and scipy? 2. How do I determine the correct values for and set LD_PRELOAD and LD_LIBRARY_PATH programmatically from inside the jar that is going to instantiate jep? 3. If (2) isn't possible, what is my alternative? 4. I'm using " -Djava.library.path=." in my command-line java call. This seems wrong to me, since I would think the current directory would be included in the java library path to begin with. (I realize that this is more of java question than a jep question, but I figured that anyone answering the previous questions could shed some light on why/why not/how I should be using java.library.path correctly). Thanks in advance for your help! |