[PyQt] problem running pyqt on xubuntu

Baz Walter bazwal at ftml.net
Sun Oct 21 00:44:58 BST 2012


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





More information about the PyQt mailing list