[PyKDE] Using SIP modules from embedded Python

Paul Giannaros ceruleanblaze at gmail.com
Mon Feb 19 12:55:56 GMT 2007


Hi there,
I have wrapped key bits of Kate's interface (as documented at 
http://developer.kde.org/documentation/library/3.5-api/kdebase-apidocs/kate/html/) 
with SIP. Firstly, thanks for SIP -- along with good documentation, ease of 
use, and Qt/KDE support it was a piece of cake.
However, my intention is to use that library from within a C++ Kate Plugin. 
The plugin embeds Python and (so far) just attempts to import the SIP-created 
module. Doing so gives an ImportError, however, which I do not get if I just 
import the module from the interactive interpreter.

The error is:
ImportError: /usr/lib/python2.5/site-packages/sip.so: undefined symbol: 
_Py_ZeroStruct.

Both my C++ plugin and my SIP extension link to python (the SIP extension does 
because if I don't I get a 'PyCObject_Type' undefined error when trying to 
import it). 

Another interesting thing is that If I isolate the importing code from the 
Kate plugin with a simple application, it imports fine.

Any ideas what's going wrong?




More information about the PyQt mailing list