├── images ├── path.png ├── test.png ├── boot1.png ├── boot2.png ├── boot3.png ├── sources.png ├── sip-4.19.24.tar.gz └── PyQt5-5.15.2.tar.gz ├── test.py └── README.md /images/path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiagordc/rpi-build-qt-pyqt/HEAD/images/path.png -------------------------------------------------------------------------------- /images/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiagordc/rpi-build-qt-pyqt/HEAD/images/test.png -------------------------------------------------------------------------------- /images/boot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiagordc/rpi-build-qt-pyqt/HEAD/images/boot1.png -------------------------------------------------------------------------------- /images/boot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiagordc/rpi-build-qt-pyqt/HEAD/images/boot2.png -------------------------------------------------------------------------------- /images/boot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiagordc/rpi-build-qt-pyqt/HEAD/images/boot3.png -------------------------------------------------------------------------------- /images/sources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiagordc/rpi-build-qt-pyqt/HEAD/images/sources.png -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | from PyQt5 import Qt, QtCore 2 | print(Qt.PYQT_VERSION_STR) 3 | print(QtCore.QT_VERSION_STR) 4 | -------------------------------------------------------------------------------- /images/sip-4.19.24.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiagordc/rpi-build-qt-pyqt/HEAD/images/sip-4.19.24.tar.gz -------------------------------------------------------------------------------- /images/PyQt5-5.15.2.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiagordc/rpi-build-qt-pyqt/HEAD/images/PyQt5-5.15.2.tar.gz -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rpi-build-qt-pyqt 2 | 3 | Build the latest Qt5 and PyQt5 on a Raspberry Pi (no cross compiling) 4 | 5 | Tested with Qt5.15.2 and PyQt5-5.15.2 on a Raspberry Pi 4 Model B 4GB 6 | 7 | Also tested to work with PyInstaller and PyArmor to create standalone packages 8 | 9 | Could only make it work with sip 4.19, recent versions break the compatibility with PyInstaller 10 | 11 | # Build 12 | 13 | 1. Uncomment source line in sources-list 14 | 15 | * sudo nano /etc/apt/sources.list 16 | 17 | ![sources](images/sources.png) 18 | 19 | * ctrl+x and y 20 | 21 | 2. Update your system 22 | 23 | * sudo apt update 24 | * sudo apt full-upgrade 25 | * sudo reboot now 26 | 27 | 3. Install [dependencies](https://wiki.qt.io/Building_Qt_5_from_Git) - not sure if all these are really required 28 | 29 | * sudo apt-get build-dep qt5-default 30 | * sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev 31 | * sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby nodejs 32 | * sudo apt-get install libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libxtst-dev libxss-dev libdbus-1-dev libevent-dev libfontconfig1-dev libcap-dev libpulse-dev libudev-dev libpci-dev libnss3-dev libasound2-dev libegl1-mesa-dev 33 | * sudo apt-get install libasound2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev 34 | * sudo apt-get install freeglut3-dev 35 | * sudo apt install libclang-6.0-dev llvm-6.0 36 | 37 | 4. Run the Qt build script 38 | 39 | * wget https://raw.githubusercontent.com/tiagordc/raspberry-pi-qt-builds/master/build-qt.sh 40 | * sudo chmod +x build-qt.sh 41 | * sh build-qt.sh 42 | 43 | 5. Qt is now build on /home/pi/qtbuild. Install it to proceed with PyQt 44 | 45 | * cd / 46 | * sudo tar xf /home/pi/qtbuild/**Qt5.15.2-rpi-bin-minimal.tgz** 47 | 48 | 6. Add Qt to PATH 49 | 50 | * nano ~/.bashrc 51 | * export LD_LIBRARY_PATH=/usr/local/**Qt-5.15.2**/lib:$LD_LIBRARY_PATH 52 | * export PATH=/usr/local/**Qt-5.15.2**/bin:$PATH 53 | 54 | ![path](images/path.png) 55 | 56 | 7. Build PyQt5 57 | 58 | * sudo apt-get install sip-dev 59 | * cd /usr/src 60 | * sudo wget https://www.riverbankcomputing.com/static/Downloads/sip/4.19.24/sip-4.19.24.tar.gz 61 | * sudo wget https://files.pythonhosted.org/packages/28/6c/640e3f5c734c296a7193079a86842a789edb7988dca39eab44579088a1d1/PyQt5-5.15.2.tar.gz 62 | * sudo tar xzf sip-4.19.24.tar.gz 63 | * sudo tar xzf PyQt5-5.15.2.tar.gz 64 | 65 | * cd sip-4.19.24 66 | * sudo python3 configure.py --sip-module PyQt5.sip 67 | * sudo make -j4 68 | * sudo make install 69 | 70 | * cd ../PyQt5-5.15.2 71 | * sudo python3 configure.py --qmake /usr/local/Qt-5.15.2/bin/qmake --confirm-license 72 | * sudo make -j4 73 | * sudo make install 74 | 75 | 8. Test 76 | 77 | * cd 78 | * sip -V 79 | * sudo wget https://raw.githubusercontent.com/tiagordc/rpi-build-qt-pyqt/master/test.py 80 | * python3 test.py 81 | 82 | # References 83 | 84 | 1. https://wiki.qt.io/Native_Build_of_Qt5_on_a_Raspberry_Pi 85 | 2. https://wiki.qt.io/Native_Build_of_Qt_5.4.1_on_a_Raspberry_Pi 86 | 3. https://wiki.qt.io/Building_Qt_5_from_Git 87 | 4. https://doc.bccnsoft.com/docs/PyQt5/installation.html 88 | 5. https://www.tal.org/tutorials/building-qt-515-raspberry-pi 89 | --------------------------------------------------------------------------------