4

I programmed a small GUI in python and PyQt4 on Ubuntu 14. When I try to run the same script on Ubuntu 18.04, I get an import error:

ModuleNotFoundError: No module named 'PyQt4'

I have installed the following packages with apt-get:

sudo apt-get install python-qt4
sudo apt-get install libqt4-dev
sudo apt-get install pyqt4-dev-tools
sudo apt-get install pyqt4.qsci-dev

Short: all the packages that should enable PyQt4 to run on machine. I haven't found anyone with the same problem nor a site stating that PyQt4 won't run on Ubuntu 18.

Could it be that there is no possibility to run PyQt4 on Ubuntu 18? Or should I take PyQt5?

Sorry if this is the wrong forum, if you can't answer this question I'll post it on stack exchange.

My Python version is 3.6.5

1
  • See my answer below for solution. I am stupid. Anyways I'm going to move to PyQt5, as this is more recent.
    – Mattu475
    Jul 11, 2018 at 8:50

1 Answer 1

11

Ok, found the error on my own. I had to do the following:

sudo apt install python3-pyqt4

classic error, I installed the old python packages. Hint: apt-get is replaced by apt.

1
  • 1
    This solved my problem after many failed "solutions" from StackExchange. Thank you! Nov 6, 2020 at 4:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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