You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.
Hello, i'm new to JPY, and wanted to try it for execute python code from a java project.
So i just made a new Java project on Eclipse, and added a test.py python module that contains a method square:
org.jpy.PyLib: entered static initializer
org.jpy.PyLibConfig: entered static initializer
org.jpy.PyLibConfig: exited static initializer
org.jpy.PyLib: System.load("C:\Users\luidicorra\AppData\Local\Programs\Python\Python38\python38.dll")
org.jpy.PyLib: System.load("C:\Users\luidicorra\eclipse-workspace-enterprise\JPY_Test\build\lib.win-amd64-3.8\jpy.cp38-win_amd64.pyd")
org.jpy.PyLib: exited static initializer
org.jpy.PyLib: Starting Python with 1 extra module path(s):
org.jpy.PyLib: C:\Users\luidicorra\eclipse-workspace-enterprise\JPY_Test\build\lib.win-amd64-3.8
PyLib_startPython: entered: jenv=000000000305E1F8, pyInit=0, JPy_Module=0000000000000000
PyLib_startPython: global Python interpreter information:
Py_GetProgramName() = "python"
Py_GetPrefix() = "C:\Users\luidicorra\AppData\Local\Programs\Python\Python38"
Py_GetExecPrefix() = "C:\Users\luidicorra\AppData\Local\Programs\Python\Python38"
Py_GetProgramFullPath() = "C:\Program Files\Java\jre1.8.0_251\bin\javaw.exe"
Py_GetPath() = "C:\Users\luidicorra\AppData\Local\Programs\Python\Python38\python38.zip;C:\Users\luidicorra\AppData\Local\Programs\Python\Python38\Lib;C:\Users\luidicorra\AppData\Local\Programs\Python\Python38\DLLs;C:\Program Files\Java\jre1.8.0_251\bin"
Py_GetPythonHome() = "(null)"
Py_GetVersion() = "3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)]"
Py_GetPlatform() = "win32"
Py_GetCompiler() = "[MSC v.1924 64 bit (AMD64)]"
Py_GetBuildInfo() = "tags/v3.8.3:6f8c832, May 13 2020, 22:37:02"
PyLib_startPython: exiting: jenv=000000000305E1F8, pyInit=1, JPy_Module=000000002066DEF0
Java_org_jpy_PyLib_executeCode: code='print('Hello!')'
Java_org_jpy_PyLib_executeInternal: using main globals
Java_org_jpy_PyLib_executeInternal: using globals for locals
Hello!
Java_org_jpy_PyLib_importModule: name='test'
PyLib_CallAndReturnObject: objId=00000000207ED220, isMethodCall=0, name='MyPlugin', argCount=0
PyLib_CallAndReturnObject: error: function or method not found: 'MyPlugin' Exception in thread "main" java.lang.RuntimeException: Error in Python interpreter:
Type: <class 'AttributeError'>
Value: module 'test' has no attribute 'MyPlugin'
Line:
Namespace:
File:
at org.jpy.PyLib.callAndReturnObject(Native Method)
at org.jpy.PyObject.call(PyObject.java:391)
at it.testjpy.app.main(app.java:32)
Somebody can help me understand where i'm wrong? I've already looked on other issue threads and searched on google for anything related to my problem, but got nothing and even after many tryes i always end up with the same error.
Hello, i'm new to JPY, and wanted to try it for execute python code from a java project.
So i just made a new Java project on Eclipse, and added a test.py python module that contains a method square:
test.py
Then i've add two java classes:
MyPlugin.java
app.java
The output is:
Somebody can help me understand where i'm wrong? I've already looked on other issue threads and searched on google for anything related to my problem, but got nothing and even after many tryes i always end up with the same error.
Edit: If needed here's my project structure
The text was updated successfully, but these errors were encountered: