Install PyQt5 on your PCLast Update : 14 Oct, 2022
When installing Python on your computer, the PyQt5 module does not install as a default module. Therefore, You have to download and install PyQt5 as a separate module in Python.
In this tutorial, you will learn to install PyQt5 on your PC. The following is the installation guide of PyQt5 for your computer with Linux, Mac, and Windows operating systems.
How to Install PyQt5 on Linux Operating System?
When you install the Linux operating system on your PC, Python is often installed by default most of the time. But before installing PyQt5, you need to make sure Python 3.x version is already installed on your PC, because of all the features and ease of use.
Considering Ubuntu Linux OS, most of the time includes both python2 and python3 versions. For PyQt5, need to use Python 3.
Also, You can use the following command to verify the installed version is Python 3.x on your PC.
If you verified that you have Python 3, You can install PyQt5.
Also, If you have some experience in Linux operating system, it is not difficult to PyQT5. You can install it using the Linux software package manager.
The software package manager you need to use depends on the Linux distribution installed on your PC.
If you're using CentOS 7, use the following command.
yum install qt5-qtbase-devel
If you're using Ubuntu Linux or Debian Linux, use the following command.
sudo apt-get install python3-pyqt5
If you're using RPM-based systems (Redhat-based), use the following command.
yum install PyQt5
How to install PyQt5 on Mac OS X
Installing PyQt5 on Apple Mac OS X is a bit simple. For this, first, you need to install Qt Mac OS X binary.
But, to use it with Python, you need to install the PyQt5 python module. You can install it using brew.
Use the following brew command in the terminal to install PyQt5.
brew install PyQt5
How to install PyQt5 on Windows Operating System?
You need to follow a few steps to install PyQt5 on Windows.
First, download and install the installer from the qt-project website. from qt to install PyQt.
Next, install Python version 3.3 or newer version. Also, In the installation process, Check the box to add all of the PyQt5 extras.
Further, do not need to compile everything from the source, you can install all the required packages with the installer.
If you're using Python 3.6 or a Newer version, You can use to the following command to install PyQt5.
pip install pyqt5
The above command installs PyQt5 on your windows PC without any problems.