Before you start building GUI applications with the Raspberry Pi you will need to have a working installation of PyQt5 or PyQt6 on your system. If you don't have either set up yet, the following steps will guide you through how to do this on Windows.
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 on Raspberry Pi is very straightforward as packages for PyQt5 are available in Raspbian repositories. In Raspbian you can install either from the
command line using apt
. The package you are looking for is named python3-pyqt5
.
You can also install these from the command line as follows --
sudo apt install python3-pyqt5
After install is finished, you should be able to run python
(or python3
) and import PyQt5
without errors.
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.
Never miss an update
Enjoyed this? Subscribe to get new updates straight in your Inbox.