Install PyQt5 on Raspberry Pi

How to Install PyQt5 on Raspberry Pi Raspbian for Python GUI Development
Heads up! You've already completed this tutorial.

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:

sh
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
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.

PyQt6 Crash Course by Martin Fitzpatrick — The important parts of PyQt6 in bite-size chunks

See the course

Well done, you've finished this tutorial! Mark As Complete
[[ user.completed.length ]] completed [[ user.streak+1 ]] day streak
Martin Fitzpatrick

Install PyQt5 on Raspberry Pi was written by Martin Fitzpatrick.

Martin Fitzpatrick is the creator of Python GUIs, and has been developing Python/Qt applications for the past 12+ years. He has written a number of popular Python books and provides Python software development & consulting for teams and startups.