dll load failed when loading numpy in embedded python
Hi everyone, I get the error: 'DLL load failed' when loading numpy in embedded python. I could not find a solution in the archive. Any help appreciated. I have written a test as follows (borrowed from an other post): #include <stdlib.h> #include <stdio.h> #include <Python.h> int load(){ PyObject *errobj, *errdata, *errtraceback; char* code = "import numpy\n"; Py_Initialize(); PyObject *m = PyImport_AddModule("__main__"); PyObject* d = PyModule_GetDict( m ); PyObject * resu = PyRun_String( code, Py_file_input, d, d); PyErr_Fetch (&errobj, &errdata, &errtraceback); if (errdata != NULL){ PyObject *s = PyObject_Str(errdata); char * c = PyString_AS_STRING(s); printf("%s\n",c); Py_DECREF(s); }else{ printf("no errors.\n"); } Py_XDECREF(errobj); Py_XDECREF(errdata); Py_XDECREF(errtraceback); Py_Finalize(); return 0; } int main(int argc, char **argv){ load(); return 0; } this is build using: gcc -I/openSource/python26/include -ggdb -c t.c -oc.o -Wall gcc c.o C:\openSource\python26\libs\libpython26.a -otest.exe -Wall configuration is: windows vista mingw gcc 4.5.0 python 2.6 numpy 1.5 -- Jean-François MAUREL
On Mon, Sep 6, 2010 at 3:27 PM, Jean-François MAUREL <jfr.maurel@gmail.com> wrote:
Hi everyone,
I get the error: 'DLL load failed' when loading numpy in embedded python. I could not find a solution in the archive. Any help appreciated.
Could you get a more detailed log (looking into one of myriad logging system in windows) ? It should say why the dll fails loading (missing function, file not found, etc...). cheers, David
Le 06/09/2010 08:45, David Cournapeau a écrit :
Could you get a more detailed log (looking into one of myriad logging system in windows) ? It should say why the dll fails loading (missing function, file not found, etc...).
cheers, Thank you for your quick answer. Unfortunately no success looking in windows log files. Any idea where to look more specifically?
Regards -- Jean-François MAUREL
On 9/5/2010 11:27 PM, Jean-François MAUREL wrote:
Hi everyone,
I get the error: 'DLL load failed' when loading numpy in embedded python. I could not find a solution in the archive. Any help appreciated.
I have written a test as follows (borrowed from an other post): #include<stdlib.h> #include<stdio.h> #include<Python.h>
int load(){ PyObject *errobj, *errdata, *errtraceback; char* code = "import numpy\n"; Py_Initialize(); PyObject *m = PyImport_AddModule("__main__"); PyObject* d = PyModule_GetDict( m ); PyObject * resu = PyRun_String( code, Py_file_input, d, d); PyErr_Fetch (&errobj,&errdata,&errtraceback); if (errdata != NULL){ PyObject *s = PyObject_Str(errdata); char * c = PyString_AS_STRING(s); printf("%s\n",c); Py_DECREF(s); }else{ printf("no errors.\n"); } Py_XDECREF(errobj); Py_XDECREF(errdata); Py_XDECREF(errtraceback); Py_Finalize(); return 0; }
int main(int argc, char **argv){ load(); return 0; }
this is build using: gcc -I/openSource/python26/include -ggdb -c t.c -oc.o -Wall gcc c.o C:\openSource\python26\libs\libpython26.a -otest.exe -Wall
configuration is: windows vista mingw gcc 4.5.0 python 2.6 numpy 1.5
Your test program worked for me. Try opening the file test.exe with Dependecy Walker <http://www.dependencywalker.com/> and see which DLLs are found or missing. Christoph
Le 06/09/2010 09:07, Christoph Gohlke a écrit :
Your test program worked for me. Try opening the file test.exe with Dependecy Walker<http://www.dependencywalker.com/> and see which DLLs are found or missing.
Christoph
Thank you, i will try this one regards -- Jean-François MAUREL
Le 06/09/2010 09:26, Jean-François MAUREL a écrit :
Le 06/09/2010 09:07, Christoph Gohlke a écrit :
Your test program worked for me. Try opening the file test.exe with Dependecy Walker<http://www.dependencywalker.com/> and see which DLLs are found or missing.
Christoph Thank you, i will try this one
regards
problem remains. dependencywalker only found missing IEShims.dll which I added in the path but the error is still there. I only have a warning now from dependencywalker on ieframe.dll. @Cristoph: What was your configuration when executing the test successfully (os, compiler)? Regards -- Jean-François MAUREL
Le 06/09/2010 12:19, Jean-François MAUREL a écrit :
Le 06/09/2010 09:26, Jean-François MAUREL a écrit :
Le 06/09/2010 09:07, Christoph Gohlke a écrit :
Your test program worked for me. Try opening the file test.exe with Dependecy Walker<http://www.dependencywalker.com/> and see which DLLs are found or missing.
Christoph Thank you, i will try this one
regards
using profiling in dependencyWalker I found this: LoadLibraryExA("C:\openSource\python26\lib\site-packages\numpy\core\multiarray.pyd", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from "PYTHON26.DLL" at address 0x1E02D9BD. *Loaded "MULTIARRAY.PYD" at address 0x69B80000. Successfully hooked module.* Unloaded "MULTIARRAY.PYD" at address 0x69B80000. *LoadLibraryExA("C:\openSource\python26\lib\site-packages\numpy\core\multiarray.pyd", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: Le module spcifi est introuvable (126). * any ideas? regards -- Jean-François MAUREL
Le 06/09/2010 08:27, Jean-François MAUREL a écrit :
Hi everyone,
I get the error: 'DLL load failed' when loading numpy in embedded python. I could not find a solution in the archive. Any help appreciated.
I have written a test as follows (borrowed from an other post): #include<stdlib.h> #include<stdio.h> #include<Python.h>
int load(){ PyObject *errobj, *errdata, *errtraceback; char* code = "import numpy\n"; Py_Initialize(); PyObject *m = PyImport_AddModule("__main__"); PyObject* d = PyModule_GetDict( m ); PyObject * resu = PyRun_String( code, Py_file_input, d, d); PyErr_Fetch (&errobj,&errdata,&errtraceback); if (errdata != NULL){ PyObject *s = PyObject_Str(errdata); char * c = PyString_AS_STRING(s); printf("%s\n",c); Py_DECREF(s); }else{ printf("no errors.\n"); } Py_XDECREF(errobj); Py_XDECREF(errdata); Py_XDECREF(errtraceback); Py_Finalize(); return 0; }
int main(int argc, char **argv){ load(); return 0; }
this is build using: gcc -I/openSource/python26/include -ggdb -c t.c -oc.o -Wall gcc c.o C:\openSource\python26\libs\libpython26.a -otest.exe -Wall
configuration is: windows vista mingw gcc 4.5.0 python 2.6 numpy 1.5
For the record I intalled python 2.6.6 instead of an old 2.6.1 I had and it works Regards -- Jean-François MAUREL
participants (3)
-
Christoph Gohlke
-
David Cournapeau
-
Jean-François MAUREL