-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jep.JepException: <type 'exceptions.ImportError'>: No module named python.framework #173
Comments
It looks like keras is just failing because part of tensorflow is failing. Can you get rid of the
I expect the third line will fail since that is what keras is doing when it fails but I am hoping the print statement will give you some indication what is wrong with tensorflow. Also have you verified that you can import keras from python, without using jep? |
As asked, I have modified the code of Hello.kt this way:
The output is
I wonder why EDIT: After removing dependencies on Is there any common / incompatible dependency between JEP and DL4j ? Here is the pom part with the problem :
|
dl4j must be pulling in a Java package named tensorflow. By default Jep scans the classpath and allows you to import all your Java packages into Python, this takes precedence over the Python packages if there is a naming conflict. To resolve this I recommend passing a custom ClassEnquirer into you JepConfig. You want to make sure that isJavaPackage() returns false for tensorflow. You should be able to simply extend the default ClassList and overriding that one method to check for tensorflow. |
Thank you very much for your advice. It worked.
and modified my Jep loading code with :
Now Jep, tensorflow on Python and Dl4j are working together. |
macOS 10.14.1
macOS's 2.7.10
Oracle 1.8.0_172
3.8.2 installed with pip2
keras and tensorflow.
When I run a simple python script it seems to work great but if I try to import Keras, it throws an exception:
jep.JepException: <type 'exceptions.ImportError'>: No module named python.framework
I've tried to install jep on 3 different macs with the same result.
I was also unable to install JEP with Python 3.7.1 with following error
TypeError: '_NamespacePath' object does not support indexing
I've joined a Kotlin source code demonstrating this behaviour.
Its output is :
Hello.kt.gz
The text was updated successfully, but these errors were encountered: