无法使用pip安装PyQt5

时间:2019-06-02 20:50:58

标签: python pyqt pip pyqt5

我尝试使用来安装PyQt5

pip install PyQt5

sudo -H pip install PyQt5

他们两个都给我错误

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

我使用Ubuntu 18.04。

我的python版本是:Python 2.7.15rc1


我已经安装了python3-pip,并尝试使用来安装PyQt5

pip3 install PyQt5

我得到了错误

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

我的python3版本是:Python3.6.7。

4 个答案:

答案 0 :(得分:5)

您需要升级点数

pip install --user --upgrade pip

然后重新安装

pip install PyQt5

pip3 install PyQt5

答案 1 :(得分:2)

尝试一下:

python3 -m pip install PyQt5

答案 2 :(得分:1)

我知道答案有点晚了。 在PyCharm中,即使升级了点子也会在此软件包中产生错误。 将PyQt5版本降级为5.12.2可以正常工作。 使用

sequence_id

或者,

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

对我来说很好。

答案 3 :(得分:0)

您可以运行命令

   pip3 install PyQt5

或对于Python 2,您可以从https://www.riverbankcomputing.com/software/pyqt/download5手动安装