--
You received this message because you are subscribed to the Google Groups "Jep Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jep-project+unsubscribe@googlegroups.com.
To post to this group, send email to jep-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jep-project/d00a39a6-1e6e-49ac-a219-2649a2f38884%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To fix the problem you can debug into ClassList and try to figure out why it doesn't see the class as a Java class, or you can implement your own ClassEnquirer and set that on the JepConfig used to initialize the Jep instance.Hi, the ImportError and "No module named" indicate that it's trying to import the Java class as a Python module. Otherwise you would get a ClassNotFoundException or an error such as "LoadClass failed".Jep has an interface ClassEnquirer that is used to determine if it should try to import from Java or Python. It will try an import from one or the other, not both. In this case it appears that you have a Java class but the ClassEnquirer determined otherwise and tried to import it from Python. You can set a ClassEnquirer on a JepConfig object that is then used to initialize the Jep instance. See the javadoc for more information.
The default ClassEnquirer is a class named ClassList which identifies all the JRE classes and classes from the Java classpath as Java classes, anything else is considered a Python module. The ClassLoader is also used so if the Java classloader can't see your class, it's likely that it's considered a Python module.
On Thu, Feb 9, 2017 at 2:27 PM, erikj <er...@noao.edu> wrote:
Hello. I have successfully been using Jep as an embedded python script engine in a Java-based control system for a couple of weeks now. Yesterday I ran into a problem and I cannot figure out what the cause is. In the python code I have the following import statement for a java class:
from atst.wccs.cv.camera import CameraController
This class exists and is in the search path of the python interpreter. I have other java classes in the same tree that are imported with no problem. When Jep tries to load this class I get the following error:
jep.JepException: <class 'ImportError'>: No module named 'atst.wccs.cv.camera'
I have tried everything I can think of to troubleshoot this without any luck. I have even eliminated all shared modules and had the import as the only statement in the python script that is executed. When I google search on "No module named" I come up with a few hits for errors that appear to be unrelated to this issue.
Has anyone encountered a problem like this? Any guidance is appreciated.
Thanks in advance,
Erik
--
You received this message because you are subscribed to the Google Groups "Jep Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jep-project...@googlegroups.com.