python – How to install PySide2 / PyQt5 on Raspberry Pi with QtWebEngine?

So I finally found the solution myself. From what I understand, the reason you cannot find QtWebEngine in the Raspberry Pi OS repositories, is that the Pi OS is made to run on all Raspberry Pi’s, including Pi 1 and Pi 2, which have an ARMv6 and ARMv7 CPU architecture respectively. The WebEngine module however is platform dependend and not tested, compiled and distributed for ARMv6/7 anymore, so they won’t release it in the repositories for Raspberry Pi OS. Luckily though, the Raspberry Pi 3 that I use has ARMv8, so it is possible to install QtWebEngine from Debian repositories, which offer QtWebEngine for exactly that architecture. Here is how:

Open your sources.list file

sudo nano /etc/apt/source.list

Add the following line and save/close:

deb buster main

Now update your package list

sudo apt update

It is possible that you encounter some errors concerning missing public keys, which we will now validate through a keyserver:

sudo apt-key adv --keyserver --recv-keys 648ACFD622F3D138

Note that the key 648ACFD622F3D138 was the first one to be shown in the error message from the previous step. It actually told me there were 3 missing keys, but dealing with the first one was sufficient to now update the package list once again and then being able to install the module finally.

sudo apt update
sudo apt-get install python3-pyside2.qtwebengine

Read more here: Source link