Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install PyQt5 using pip

I have tried to install PyQt5 using

pip install PyQt5

and

sudo -H pip install PyQt5

both of them give me the errors

ERROR: Could not find a version that satisfies the requirement PyQt5 (from versions: none)
ERROR: No matching distribution found for PyQt5

I use Ubuntu 18.04.

My python version is: Python 2.7.15rc1


I have already installed python3-pip and tried to install PyQt5 using

pip3 install PyQt5

I get the error

Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3241, in <module>
    @_call_aside
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3225, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found and is required by the application

My python3 version is: Python3.6.7.

like image 768
rsaavedra Avatar asked Jun 02 '19 20:06

rsaavedra


3 Answers

You need to upgrade your pip

pip install --user --upgrade pip

Then do a fresh install

pip install PyQt5

or

pip3 install PyQt5
like image 74
Muhammad Avatar answered Nov 15 '22 18:11

Muhammad


I know it is a bit late to answer. In PyCharm, even upgraded pip gives error in this package. Downgraded the PyQt5 version to 5.12.2 works fine. Use,

pip install PyQt5==5.12.2 
pip install PyQtWebEngine==5.12

Or,

pip3 install PyQt5==5.12.2
pip3 install PyQtWebEngine==5.12

Works fine for me.

like image 38
Siva Subramanian Avatar answered Nov 15 '22 18:11

Siva Subramanian


Try this:

python3 -m pip install PyQt5
like image 32
Mwangi Kabiru Avatar answered Nov 15 '22 19:11

Mwangi Kabiru