I want to install PyQt5 on Ubuntu 14.04.2. Once downloaded and uncompressed, I run python configure.py as it is mentioned on the previous link. However, it asks me to install QT 5 or later. Which thing I did.

When I come back to run the command above, I get the same error:

begueradj@begueradj-hacker:~/Bureau/PyQt-gpl-5.4.1# python configure.py 
Querying qmake about your Qt installation...
Error: PyQt5 requires Qt v5.0 or later. You seem to be using v4.8.6. Use the
--qmake flag to specify the correct version of qmake.

However, after Qt5 installation, when I run this: qmake --version

I get this:

QMake version 2.01a
Using Qt version 4.8.6 in /usr/lib/x86_64-linux-gnu

How to make use of the new Qt5 version instead ? (it is installed in /opt/qt/)

How to resolve this ?

  • 3
    Qt 5 is included in the default repositories. If you run sudo apt-get install qt5-default, it should install the basic Qt 5 development environment and set Qt 5 as the default for qmake. – saiarcot895 Apr 14 '15 at 16:03
  • Following up on the comment by @saiarcot895 -- is there any reason for why you installed the PyQt libraries from upstream? Do you have specific version requirements? I mean, are you asking for support of your custom Qt installation in /opt? Because it will be hard to receive support on a non-Ubuntu installation of Qt. – gertvdijk Apr 14 '15 at 16:05
  • @saiarcot895 sorry, i can not kiss you, you're a man :) Thank you very much, it works now – user284234 Apr 14 '15 at 16:06
  • 1
    @begueradj It will install bindings for the Ubuntu packaged Qt, not for the Qt installation in /opt. – gertvdijk Apr 14 '15 at 16:06
  • @gertvdijk thank you very much for the information – user284234 Apr 14 '15 at 16:08

As @saiarcot895 said through his comment months ago, Qt 5 is included in the default repositories. I run sudo apt-get install qt5-default . The problem is fixed

|improve this answer|||||
  • This did not work for me. I am also running Ubuntu 14.04. I get "Using Qt version 4.8.7 in /home/username/anaconda3/lib" – Frikster Feb 5 '16 at 1:42

Just so that another unfortunate soul doesn't go on the same wild goose chase, as noted by a comment here, as of Feb 2015 you can now do

sudo apt-get install python3-pyqt5

Worked like a charm for my script in pycharm

|improve this answer|||||

Your Answer

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