I have following code
#include <boost/python.hpp>
int main()
{
Py_Initialize();
namespace python = boost::python;
try {
python::object main = python::import("sample");
} catch(...) {
PyErr_Print();
PyErr_Clear();
}
}
I get following error:
ImportError: No module named sample
I put my sample.py at the same directory as this program.
PYTHONVERBOSEenvironment variable to2. This will cause Python to print where python is trying to import files.