[Eric] Eric5 and PyQt4 for python2 and python3 coexistence

Detlev Offenbach detlev at die-offenbachs.de
Tue Aug 30 17:10:59 BST 2011


On Dienstag, 30. August 2011, Mikhail Terekhov wrote:
> On Mon, Aug 29, 2011 at 12:18 PM, Detlev Offenbach
> <detlev at die-offenbachs.de
> 
> > wrote:
> > 
> > in principal this could be made configurable with the current names as
> > defaults. However, that would mean, that on openSUSE installations user
> > will
> > not be able to develop without configuring these settings which might
> > cause a
> > bunch of false error reports. As both variants of the tools produce
> > correct results, there should be no need to differentiate between the
> > two. If you would like to have them both, please think of another
> > method.
> 
> AFAICS the pyuic4 is called in ProjectFormsBrowser.py as 'pyuic4 + <args>'.
> pyuic4 is just a shell script with hard-coded python version.
> Suppose that I have installed PyQt4 first for python2 and then for python3.
> That means pyuic4 will be like this:
> 
> ~> cat /usr/local/bin/pyuic4
> #!/bin/sh
> exec /usr/bin/python3 /usr/lib/python3.2/site-packages/PyQt4/uic/pyuic.py
> ${1+"$@"}
> ~>
> 
> Now imagine that I start eric5 and create a project with project language
> Python2 and project type PyQt GUI. Then when I'd compile my project's ui
> files eric5 will call pyuic4 script that would compile ui files for python3
> not for python2. Is my analysis correct?

Your conclusion is wrong. The generated Python source will work for both 
variants.

> 
> May be the solution is instead of calling the shell script 'pyuic4 <args>'
> it would be better to call python executable (configured in preferences)
> like this: '<python version for the project> -m PyQt4.uic.pyuic + <args>'.
> Then it will be possible to have different PyQt4 versions for python2 and
> python3 installed simultaneously and independently.

That would only work for pyuic because that is a Python program. However, 
there is no need for this (s. above and Phil's answer).

The other PyQt4 tools used by eric (pyludate4 and pyrcc4) are either version 
independant (pylupdate4) or provide a switch (pyrcc4).

I don't see the need to differentiate except for packaging reasons.

Regards,
Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the Eric mailing list