【问题标题】:Why can't I install PyQt5 from the pypi?为什么我不能从 pypi 安装 PyQt5?
【发布时间】:2018-06-22 15:44:45
【问题描述】:

我想在 pycharm 中使用 PyQt5。尝试从可用包安装包后,出现错误:“安装包失败:安装包 PyQt5 时出错。”
完整的日志在这里:

------------------------------------------------------------
C:\Program Files (x86)\JetBrains\PyCharm 3.0.1\helpers\packaging_tool.py run on 02/05/14 16:13:23
Downloading/unpacking PyQt5

  Getting page https://pypi.python.org/simple/PyQt5/
  URLs to search for versions for PyQt5:
  * https://pypi.python.org/simple/PyQt5/
  Analyzing links from page https://pypi.python.org/simple/PyQt5/
  Could not find any downloads that satisfy the requirement PyQt5

No distributions at all found for PyQt5

Exception information:
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pip-1.3.1-py2.7.egg\pip\basecommand.py", line 139, in main
    status = self.run(options, args)
  File "C:\Python27\lib\site-packages\pip-1.3.1-py2.7.egg\pip\commands\install.py", line 266, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "C:\Python27\lib\site-packages\pip-1.3.1-py2.7.egg\pip\req.py", line 1026, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "C:\Python27\lib\site-packages\pip-1.3.1-py2.7.egg\pip\index.py", line 171, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for PyQt5

我该怎么办?

这就是我所做的:

  • 安装 Python 3.3 并添加到 PATH
  • 已安装PyQt5-5.2-gpl-Py3.3-Qt5.2.0-x64.exe

而且我不知道如何在 pycharm 中使用PyQt
你能提供更多信息吗?

【问题讨论】:

    标签: python qt pyqt pycharm


    【解决方案1】:

    AFAIK,您无法从 PyPI 安装 PyQt4/PyQt5。您必须单独安装它。

    如果您看到this 链接,您可以看到 PyPI 上没有列出 PyQt5(同样适用于 PyQt4)的包。因此,您需要从here 单独下载安装程序并进行安装。

    这就是

    DistributionNotFound:没有找到 PyQt5 的发行版

    指。

    [更新]:您很可能还需要以同样的方式安装 sip,方法如下:https://askubuntu.com/a/666336/12214

    【讨论】:

    • 对不起,我之前没用过PyCharm,所以不能给你任何建议。
    • 您更喜欢哪个 IDE?告诉我名字,如果可以的话,告诉我如何在那个 IDE 中安装 pyqt。我只想使用pyqt。 IDE 不重要。
    • 不管怎样,只要在你的系统上安装 PyQt4 就可以使用 Eclipse IDE。只需说服自己它会起作用而无需做任何其他事情:-)
    • 我想我已经在我的系统(Windows 8)上安装了 PyQt,但是当我在 pycharm 中尝试使用该库时,它说没有名为 PyQt 的库!我如何才能找到它是否安装在我的系统上?
    • 从 Python 解释器中,执行 import PyQt4。如果没有安装会报错。
    【解决方案2】:

    仅供参考,使用 pip 安装 QtPy5 在 3.6.5 中有效。根据https://www.riverbankcomputing.com/software/sip/download 甚至 3.5 及更高版本。

    【讨论】:

      猜你喜欢
      • 2021-12-25
      • 2019-07-22
      • 2012-12-02
      • 1970-01-01
      • 2018-05-14
      • 2021-02-26
      • 2018-02-27
      • 2016-10-11
      • 1970-01-01
      相关资源
      最近更新 更多