2

I am trying to get the script here to work on Raspberry Pi. I have tested it on Windows and Ubuntu and it works fine. But getting pyqt5 working on RPi seems to be a challenge. On Ubuntu the following works:

sudo apt-get python3.5
sudo pip3 install pyqt5

But this doesnt work on Pi as there is no pyqt5 package.

I have tried the below, but while it runs fine I dont think that actually creates python modules:

sudo apt-get install qt5-default pyqt5-dev pyqt5-dev-tools

I have tried the below, but it gives me "No files/directories in /tmp/pip-build-2rya72fo/python-qt5/pip-egg-info (from PKG-INFO)"

pip3 install python-qt5    

What is the correct way to get pyqt5 working with Python on Raspberry Pi (Jessie)? I need pyqt5 for the WebEngine support.

1 Answer 1

5

Generally a good idea is to do a search on the Pi.

apt-cache search pyqt5

Perhaps the command you need is

sudo apt-get install python3-pyqt5

I suggest you always preferentially use apt-get rather than pip.

2
  • Thanks, but isn't apt-get used to install programs rather than Python modules? How will python be aware of the install and where will the necessary python scripts install to? Commented Feb 10, 2018 at 23:10
  • Aha. I started with a fresh image of Jessie and this seemed to work. I can now import PyQt5 into python. I think the problem before was that I was trying to install python-pyqt5 instead of python3-pyqt5. I expect that also explains why the pip install failed. However now I get an error on one module: QtWebEngineWidgets. I will google that issue separately. Commented Feb 11, 2018 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.