This is a very basic question, but it has me stumped.
I am trying to embed some scipy routines into a c-program. However, I am unable to successfully complete the initial step of importing any scipy modules.
I can import the top-level of scipy, without getting a null return value, so I'm pretty sure the install is not a problem...
PyObject *pckg_name, *pckg;
pckg_name = PyString_FromString("scipy");
pckg = PyImport_Import(pckg_name);
if (!pckg)
{
printf("Error importing python module %s.\n");
return;
}
...but I am unable to get to any lower level. I've tried all kinds of combinations with PyImport_Import and PyImport_ImportModule, e.g. importing "scipy.stats" as step 1, or importing stats as step 2 after importing scipy, but nothing is working.
I am able to import and use functions from the "random" module, so I don't think there's a problem with my base Python install. I know I'm missing something obvious here, but I can't figure out what it is.