Before you start building Python GUI applications with the Raspberry Pi you will need to have a working installation of PyQt5 on your system. If you don't have it set up yet, the following steps will guide you through how to install PyQt5 on Raspberry Pi Raspbian.
Note that the following instructions are only for installation of the GPL licensed version of PyQt. If you need to use PyQt in a non-GPL project you will need to purchase an alternative license from Riverbank Computing to release your software.
Install PyQt5 on Raspberry Pi Raspbian
Installation of PyQt5 on Raspberry Pi is very straightforward as packages are available in the Raspbian repositories. You can install PyQt5 from the
command line using apt. The package you are looking for is named python3-pyqt5.
Run the following command in a terminal to install PyQt5 on your Raspberry Pi:
sudo apt install python3-pyqt5
Verify the PyQt5 Installation
After the install is finished, you should verify that PyQt5 is working correctly. Open a terminal and run python3, then import PyQt5. If no errors appear, the installation was successful.
Python 3.7.6
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5
>>>
You can now start creating Python GUI applications with PyQt5.