I am running OSX Lion and trying to import the python module for goocanvas, using python2.7.
I managed to successfully compile pygoocanvas-0.14.1, but when I try to import goocanvas
through the python2.7 console, I get a segfault. After some debugging, I'm led to this code:
DL_EXPORT (void)
initgoocanvas (void)
{
PyObject *m, *d;
fprintf(stderr,"init<< \n");
// Pycairo_IMPORT; // XXX removed, it expands to the line below, anyways
Pycairo_CAPI = (Pycairo_CAPI_t*) PyCObject_Import("cairo", "CAPI"); // ADDED XXX
fprintf(stderr,"after import<< \n");
if (Pycairo_CAPI == NULL) {
return;
}
I discovered that the segfault happens when the C++ code of the goocanvas python module tries to import the "cairo" library through PyCObject_Import("cairo", "CAPI")
. However, if I try to import the cairo module directly through the python2.7 console via import cairo
, it works.
How should I proceed? I have a blind seg fault and no idea on why it happens. Remembering that I managed to compile the python goocanvas module, but it segfaults upon trying to import it on python.