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 embedded interpreter to look at the folder where my application resides. So in the application diectory, I have the Lib, Libs and DLLs folder for Python.
In the code, I have used Py_SetPythonHome() an Py_SetProgramName() to get Python loaded and also to allow standard libraries to be installed.
One of the test scripts I'm using has:
import csv
import numpy
The csv line is now fine. Within the \libs directory I can see site-packages\numpy. But the import crashes on this line. I am using numpy 1.6.1 for this.
I think I might need to change the module search path - is this right and what is the best way to achieve this to allow third-party libraries like numpy to be accessible to my scripts? You can assume that I could produce an absolute path to the numpy directory if that would help.
EDIT: More information - I've managed to produce the traceback and the error I'm getting is in \numpy\core\_init_.py when it tries the line "import multiarray" with the error "ImportError: DLL load failed: The specified module connot be found". Checking the directory, I find a multiarray.pyd. Any thoughts?