Problem compiling Keras4Delphi.exe
asis1988 opened this issue · 4 comments
Hello everyone.
I think I have done everthing correct, but I dont know why, when I try to compile Keras4Delphi.exe I receive this:
[dcc32 Error] Python.Utils.pas(836): E2003 Undeclared identifier: 'PyDict_Update'
[dcc32 Error] Python.Utils.pas(933): E2003 Undeclared identifier: 'PyLong_FromUnsignedLongLong'
[dcc32 Error] Python.Utils.pas(1132): E2003 Undeclared identifier: 'PyFloat_FromString'
[dcc32 Error] Python.Utils.pas(1362): E2003 Undeclared identifier: 'PySequence_List'
[dcc32 Fatal Error] untMain.pas(9): F2063 Could not compile used unit 'Python.Utils.pas'
Every undeclared identifier are supossed to be part of TPythonEngine, but I cannot find any of this in PythonEngine.pas, where its defined.
Anyone can help me?
Thank you!
Added this in public declaration in TPythonInterface class in PythonEngine.pas
` PyBaseString_Type: PPyTypeObject;
PyBool_Type: PPyTypeObject;
PyEnum_Type: PPyTypeObject;
// ******* Added by Max 01/06/2020 19:00:53 ***********
PyDict_Update: function (a: PPyObject; b: PPyObject):Integer; cdecl;
PyLong_FromUnsignedLongLong:function(val:UInt64) : PPyObject; cdecl;
PyFloat_FromString:function (str:PPyObject):PPyObject; cdecl;
PySequence_List:function (o:PPyObject):PPyObject; cdecl;
// ******* Added by Max 01/06/2020 19:00:53 ***********
PyComplex_FromCComplex: function(c: Py_complex):PPyObject; cdecl;`
Hello everyone, and thanks to Pigrecos for this awesome library.
I've installed the Python4Delphi appropriately and run the codes without error.
Then, I tried to Keras4Delphi in Delphi 10.4 by updating the necessary lines given above. I've compiled the test project but when I run the test project EPythonError exeption was occured with the message "Could not get var "int64", because it is not yet initialized.". I've checked out the code for the initialization of NumPy that loads the module using a Prython engine (g_MyPyEngine), I saw that the modulde handle is not null I mean NumPy module has been loaded. I think NumPy.init code (which is the constructor) was executed.
Can you help me? I've checked the code in detail but can not run the test project.
Hi all,
I've compiled and run the test project, just added some python paths to the environmental PATH variable using system properties, and it's OK.