Best way to install PyQt5 for Python 2.7 on Ubuntu 14.04

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

2

2 Answers

I have found my answer for this question here:

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:

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

2

I highly recommend you to install Anaconda and install it using conda

conda install pyqt

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like