[PyKDE] Multiple PyQt version in one Python installation

Phil Thompson phil at riverbankcomputing.co.uk
Sat Nov 4 23:29:08 GMT 2006

On Saturday 04 November 2006 10:08 pm, Simon Edwards wrote:
> On Saturday 04 November 2006 21:38, Phil Thompson wrote:
> > On Saturday 04 November 2006 7:47 pm, Simon Edwards wrote:
> > > This would be very useful for PyKDE and KDE 4. Phil, what do you think?
> >
> > Yuck. So, in the hypothetical case where a binary incompatibility is
> > introduced you then go through all your existing applications and change
> > the Python source code???
> It only applies to code brings its own wrapper C+ classes. It would be the
> responsibility of the developer of the application to keep any
> explicit "import sipX" statements in sync with what they are using to
> compile their wrappers for their custom C++ classes.

But a binary incompatibility is an issue for the person compiling and 
installing the wrappers, not for the person writing them. The wrappers could 
work perfectly well with either incompatible SIP versions without change.

> > If you want module version dependencies then don't eggs give you what you
> > need?
> From what little I just read about python eggs, it looks like it kind of
> does the things that I'm after. Would PyQt be able to fit into such a
> system? I'm, supporting multiple versions and all?

I'm not an egg expert either - in particular I don't know if it has issues 
with extension modules rather than pure Python modules.

> > Why do you think there is something called libsip that a C++ class is
> > compiled
> > against?
> sip.so. Point is, once a SIP wrapper for a custom C++ class is compiled it
> then depends on that particular version of sip.

No it doesn't.

> Trying to run a program 
> that uses a PyQt compiled for sip version X, and uses a custom C++ class
> compiled for sip version Y, will fail. Python programs can't mix two
> versions of sip.

You can't mix two versions of SIP with different API major version numbers. 
This was last changed to allow PyQt3 and PyQt4 to be installed side by side. 
I do not anticipate it changing during the life of Qt4 (but I won't make a 
commitment to that effect).


More information about the PyQt mailing list