How To Allow 3rd-party Libraries To Be Imported By Scripts Called In Embedded Python Interpreter?
I have embedded a Python 2.7.2 interpreter into a C++ application using the Python C API. On the target machines, I can't guarantee a Python install, so I am trying to get the embe
Solution 1:
I have exactly the same problem with you, when I use python C API to import numpy. Some .pyd modules cannot be imported. When I changed to boost.python, there is no problem. Maybe you can try boost.python also. Here is sample:
Solution 2:
This turned out to be a DLL mismatch error. The numpy version that the code was looking had a slightly different compilation route to that of my C++ code that was embedding the interpreter.
The resolution was to recompile numpy against the Python distribution that I'd used in my application, but using exactly the same compiler settings. This cleared the problem.
Post a Comment for "How To Allow 3rd-party Libraries To Be Imported By Scripts Called In Embedded Python Interpreter?"