当尝试为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位。您需要下载wheel for Python 2.7” < / em>。
我也尝试过:
$ 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.
所以问题可能是:如何安装正确的版本?如何找到合适的包装?我的问题正是这个问题:我不知道如何在这个大森林中移动自己。谢谢你的每一个建议。
答案 0 :(得分:0)
默认情况下, pip 在Pypi上查找项目分发。如果您要求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,因此您可能需要看看它,看看是否可以在系统上安装它。