[PyQt] problem running pyqt on xubuntu

Phil Thompson phil at riverbankcomputing.com
Sun Oct 21 10:31:57 BST 2012


On Sun, 21 Oct 2012 08:11:11 +0100, Mark Summerfield <list at qtrac.plus.com>
wrote:
> Hi Baz,
> 
> On Sun, 21 Oct 2012 00:44:58 +0100
> Baz Walter <bazwal at ftml.net> wrote:
>> On 20/10/12 08:11, Mark Summerfield wrote:
>> > Hi,
>> >
>> > I have built local versions of Qt 4.8.3, Python, SIP, and PyQt on an
>> > Xubuntu machine which has Qt 4.8.1 as its system Qt:
>> >
>> > $ cd qt483src
>> > $ ./configure -prefix ~/opt/qt483
>> > $ make && make install
>> >
>> > $ cd py33src
>> > $ ./configure --prefix ~/opt/py33
>> > $ make && make install
>> >
>> > $ cd sip414src
>> > $ ~/opt/py33/bin/python3 configure.py
>> > $ make && make install
>> >
>> > $ cd pyqt495src
>> > $ ~/opt/py33/bin/python3 configure.py -q ~/opt/qt483/bin/qmake
>> > $ make && make install
>> >
>> > $ ./opt/py33/bin/python3 mypyqtapp.pyw
>> > Cannot mix incompatible Qt library (version 0x40801) with this
library
>> > (version 0x40803) Aborted (core dumped)
>> >
>> > So clearly, despite trying to build using my local Qt, PyQt seems to
be
>> > looking at the system Qt.
>> >
>> > Is there a solution for this?
>> 
>> One of the simplest solutions is to use LD_LIBRARY_PATH.
>> 
>> Create a wrapper "pyqt483" script like this:
>> 
>>      #!/bin/sh
>> 
>>      export LD_LIBRARY_PATH="path/to/qt4/lib"
>> 
>>      exec "path/to/bin/python" "$@"
>> 
>> Then you can test your pyqt apps like this:
>> 
>>      $ pyqt483 mypyqtapp.pyw
> 
> I will try that next week.
> 
> But I still don't understand why, if I use -q when I build PyQt, it
> makes any reference to another Qt at all.
> 
> So, ISTM, that this is a PyQt bug...

PyQt uses the qmake mkspec files from the Qt installation to get all the
compiler and linker flags. In a default linux installation this will
include using rpath to point to the Qt libs selected at compile time. A lot
of distros remove this from their custom Qt installation.

Phil


More information about the PyQt mailing list