Install PyQt5 on Linux Ubuntu
Install PyQt5 on Ubuntu and other Debian-based Linux distributions

Before you start the PyQt tutorial 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.

This guide is also available for macOS and 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 Linux

Installation on Linux is very straightforward as packages for PyQt5 are available in the repositories of most distributions. In Ubuntu you can install either from the command line or via "Software Center". The package you are looking for is named python3-pyqt5.

You can also install these from the command line as follows --

bash
apt-get install python3-pyqt5

After install is finished, you should be able to run python (or python3) and import PyQt5 without errors.

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 PyQt](/courses/pyqt).

## Install PyQt6 on Linux

Installation on Linux is very straightforward as packages for PyQt6 are available in the repositories of most distributions. In Ubuntu you can install either from the command line or via "Software Center". The package you are looking for is named `python3-pyqt6`.

You can also install these from the command line as follows --

```bash
apt-get install python3-pyqt6

After install is finished, you should be able to run python (or python3) and import PyQt6 without errors.

python
Python 3.7.6
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt6
>>>

You can now start creating Python GUI applications with PyQt.

Continue reading