Ubuntu – Best way to install PyQt5 for Python 2.7 on Ubuntu 14.04

aptpackage-managementpyqt5python

I am attempting to install PyQt5 on my Ubuntu box. I have been able to install the packages for Python 3, however,I have code that depends on pygraphviz which has a hard dependency on Python 2.7.

I was looking through the repos and I see that there is a package for it:

python-pyqt5 (5.3.2+dfsg-1ubuntu1)

So I try the following:

sudo apt-get install python-pyqt5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python-pyqt5

SO I downloaded the package and attempted to install manually:

sudo dpkg -i python-pyqt5_5.3.2+dfsg-1ubuntu1_amd64.deb 
Selecting previously unselected package python-pyqt5.
(Reading database ... 253766 files and directories currently installed.)
Preparing to unpack python-pyqt5_5.3.2+dfsg-1ubuntu1_amd64.deb ...
Unpacking python-pyqt5 (5.3.2+dfsg-1ubuntu1) ...
dpkg: dependency problems prevent configuration of python-pyqt5:
 python-pyqt5 depends on libqt5core5a (>= 5.3.0); however:
  Version of libqt5core5a:amd64 on system is 5.2.1+dfsg-1ubuntu14.3.
 python-pyqt5 depends on libqt5gui5 (>= 5.3.0) | libqt5gui5-gles (>= 5.3.0); however:
  Version of libqt5gui5:amd64 on system is 5.2.1+dfsg-1ubuntu14.3.
  Package libqt5gui5-gles is not installed.
 python-pyqt5 depends on libqt5help5 (>= 5.3.0); however:
  Version of libqt5help5:amd64 on system is 5.2.1-8build1.
 python-pyqt5 depends on libqt5network5 (>= 5.3.0); however:
  Version of libqt5network5:amd64 on system is 5.2.1+dfsg-1ubuntu14.3.
 python-pyqt5 depends on libqt5printsupport5 (>= 5.3.0); however:
  Version of libqt5printsupport5:amd64 on system is 5.2.1+dfsg-1ubuntu14.3.
 python-pyqt5 depends on libqt5widgets5 (>= 5.3.0); however:
  Version of libqt5widgets5:amd64 on system is 5.2.1+dfsg-1ubuntu14.3.
 python-pyqt5 depends on qtbase-abi-5-3-0; however:
  Package qtbase-abi-5-3-0 is not installed.
 python-pyqt5 depen
dpkg: error processing package python-pyqt5 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python-pyqt5

I see that I may have some outdated packages I have attempted to update using apt-get update with no results.

I have downloaded source to build; however, I would rather use package management to control dependencies. Is there any advice on how to resolve this using apt?

Thank you for your help!
Joseph

Best Answer

I have found my answer for this question here: https://riverbankcomputing.com/pipermail/pyqt/2014-May/034175.html

Basically, it seems that the Python 2 versions of PyQt5 were left out of the Ubuntu 14.04 repos; however, they seem to be included in 14.10.

So, I installed PyQt5 from source which was not without its own woes: https://stackoverflow.com/questions/32080304/issues-with-building-pyqt5-on-ubuntu-14-04

At any rate, I now have PyQt5 installed on my box.

Related Question