John Vance wrote:

>I've installed pygtk 0.6.9.  I have python 2.1.  I have installed a code
>editor, glimmer, which is extensible using python.  On startup, glimmer
>reports that it cannot import _gtk.
>
>I have traced the error to init_pygtk() - PyImport_ImportModule("_gtk") is
>returning NULL:
>
>#define init_pygtk() { \
>    PyObject *pygtk = PyImport_ImportModule("_gtk"); \
>    if (pygtk != NULL) { \
>    PyObject *module_dict = PyModule_GetDict(pygtk); \
>    PyObject *cobject = PyDict_GetItemString(module_dict, "_PyGtk_API"); \
>    if (PyCObject_Check(cobject)) \
>        _PyGtk_API = PyCObject_AsVoidPtr(cobject); \
>    else { \
>        Py_FatalError("could not find _PyGtk_API object"); \
>        return; \
>    } \
>    } else { \
>    Py_FatalError("could not import _gtk"); \
>    return; \
>    } \
>}
>
>However, if I start python and type "import _gtk" everything works fine.
>Similarly, if I run the example file simple1.py, which imports _gtk, it
>works perfectly.
>
>So how come PyImport_ImportModule("_gtk") is returning null in init_pygtk?
>
>This is on a Solaris 7 box.
>
Without knowing the details of how glimmer loads python and pygtk, or 
how the glimmer executable is linked, I can't really help you.

Possibly _gtkmodule.so can't find the python symbols (are they in the 
global symbol table)?  Is python initialised correctly?

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to