3

I've just cross compiled Qt5.2.1 on the rapsberry pi. I can't find out any information regarding SIP / PyQt5 cross compile on Raspbian wheezy.

I tried to compile sip / PyQt5 on the Raspberry.

  • Sip / Qt5 on Raspberry pi

    Sip builds fine but as there's no Qmake in the Qt5.2.1 directories of my kernel image previously cross-compiled on my PC. So the PyQt5 installation failed.

Note : as the Raspbian python3-sip module is not the right version for PyQt5 (minimum sip 4.15.5) you need to compile the last sources version on Raspbian

So now the question is : how to cross-compile PyQt5 on my Pc ? No documentation found about that.

  • PyQt5 on PC

After Qt5.2.1 on my PC the PyQt5 installation ran perfectly. But when TI tried to import a PyQt5 module I faced the following error

$ from PyQt5 import QtCore
ImportError: libQt5Core.so.5: cannot open shared object file: No such file or directory

On my PC this lib is located at /opt/Qt5.2.1/5.2.1/gcc_64/lib/libQt5Core.so.5 I added /opt/Qt5.2.1/5.2.1/gcc_64/lib/ to the $LD_LIBRARY_PATH and now the message is :

$ from PyQt5 import QtCore
RuntimeError: the sip module implements API v11.0 but the PyQt5.QtCore module requires API v10.1

After a quick search SIP 4.15.5 is API level 11 compliant and SIP-4.15.4 is API level 10 compliant. So trying to install SIP 4.15.4.

It Works, I can import PyQt5.QtCoe QtGui, QtNetwork ....

But I'm still stucked with the PyQt5 cross-compilation procedure that lackes.

Any idea ?

Community
  • 1
  • 1
Emmanuel BRUNET
  • 1,286
  • 3
  • 19
  • 46

1 Answers1

1

Fortunately, all the required dependencies are now available from the Debian repository pre-compiled.

Assuming you have the latest version of Raspbian (Kernel 4.14) installed, run the following commands in a terminal window:

sudo apt-get update && sudo apt-get upgrade

sudo apt-get install qt5-default

sudo apt-get install python3-pyqt5*

sudo apt-get install at-spi2-core

The last install fixes a bug I was running into on the Pi 3. It may not be necessary in your case (but will certainly do no harm.)

Moustache
  • 394
  • 2
  • 14