【问题标题】:Could not find a version that satisfies the requirement PyQt4 (from versions: )找不到满足 PyQt4 要求的版本(来自版本:)
【发布时间】:2020-02-12 03:54:53
【问题描述】:

在尝试为 python 2.7 安装 qt4 时(我需要运行一些其他开发人员编写的脚本):

$ sudo pip install PyQt4

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

附加信息:

$ python --version
Python 2.7.15+

$ pip list
Package    Version
---------- -------
numpy      1.16.5 
pip        19.3   
pyqtgraph  0.10.0 
setuptools 41.4.0 
wheel      0.33.6 

关于如何安装它有什么建议吗?

请注意我已经尝试了here提出的解决方案:

pip install PyQt4-4.11.4-cp35-none-win_amd64.whl

ERROR: PyQt4-4.11.4-cp35-none-win_amd64.whl is not a supported wheel on this platform.

我猜是因为它不是 Windows 平台,不是吗?我正在尝试在 XUbuntu 18.04 上安装它。

正如@phd 的评论之一所建议的那样“PyQt4-4.11.4-cp35-none-win_amd64.whl 适用于 Python 3.5 和 Python 64 位。您需要下载适用于 Python 2.7 的轮子”。

我也试过了:

$ pip install PyQt4‑4.11.4‑cp27‑cp27m‑win_amd64.whl

Requirement 'PyQt4‑4.11.4‑cp27‑cp27m‑win_amd64.whl' looks like a filename, but the file does not exist
PyQt4‑4.11.4‑cp27‑cp27m‑win_amd64.whl is not a valid wheel filename.

所以问题可能是:如何安装正确的版本?如何找到合适的数据包?我的问题正是这个:我不知道如何在这片大森林中移动自己。感谢您的每一个建议。

【问题讨论】:

  • 我已经尝试了该答案中的解决方案:他们没有解决问题。我正在更新问题以澄清它
  • PyQt4-4.11.4-cp35-none-win_amd64.whl 适用于 Python 3.5 和 Python 64 位。您需要为 Python 2.7 下载 wheel。
  • @phd 问题已更新。我也尝试过 2.7
  • 我投票结束这个问题,因为Can I ask questions about installation in SO? 程序员常用的软件工具,并且是软件开发独有的实用、可回答的问题。

标签: python pip installation qt4


【解决方案1】:

默认情况下 pipPypi 上查找项目分布。如果你要求pip install PyQt4,那么你也可以手动查看the page for this PyQt4 project on PyPi。在那里你最终会看到根本没有发行版可供下载,所以 pip 根本无法在任何平台上为任何 Python 版本安装任何东西。你需要寻找替代品。

你可以看看homepage of the PyQt project,你最终会找到download the PyQt4 source code的页面。有一个link on this page for the Linux source code of PyQt4,所以你可能想看看它,看看你能不能把它安装到你的系统上。

【讨论】:

    【解决方案2】:

    基于sinoroc 的回答:PyQt4 已过时,PIP 上只有 PyQt6 或 PyQt5 可用。看到这个website

    pip install PyQt6
    

    【讨论】:

    • 嗯,这对我来说比现有答案有用 1000 倍!谢谢。
    猜你喜欢
    • 2019-04-15
    • 2016-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-20
    • 2020-07-24
    • 1970-01-01
    相关资源
    最近更新 更多