5

When trying to install qt4 for python 2.7 (that I need to run some scripts written by other developers):

$ sudo pip install PyQt4

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

Additional information:

$ 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 

Any suggestion on how to install it?

Please note that I have tried the solution proposed 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.

I guess because it is not a windows platform, isn't it? I am trying to install it on XUbuntu 18.04.

As suggested in one of the comment by @phd "PyQt4-4.11.4-cp35-none-win_amd64.whl is for Python 3.5 and Python 64-bit. You need to download wheel for Python 2.7".

I have tryed also:

$ 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.

So the question can be: how to install the right version? How to find the right packet? My problem is exactly this one: I do not know how to move myself in this big forest. Thank you for every suggestion.

Leos313
  • 5,152
  • 6
  • 40
  • 69
  • 2
    Possible duplicate of [How to install PyQt4 on Windows using pip?](https://stackoverflow.com/questions/22640640/how-to-install-pyqt4-on-windows-using-pip) – Prudhvi Oct 15 '19 at 12:54
  • I have tried the solution in that answers: they do not solve the problem. I am updating the question to clarify it – Leos313 Oct 15 '19 at 13:00
  • `PyQt4-4.11.4-cp35-none-win_amd64.whl` is for Python 3.5 and Python 64-bit. You need to download wheel for Python 2.7. – phd Oct 15 '19 at 13:54
  • @phd Question updated. I have tried also with the 2.7 – Leos313 Oct 15 '19 at 14:04
  • "*looks like a filename, but the file does not exist*" Provde the correct path to the downloaded file. – phd Oct 15 '19 at 15:13
  • @phd, you are absolutely right. The problem, as explained in the question, is that I do not know (1) how to find packets that cannot be installed through `pip` or `conda install` and (2) how to find the right path in this specific case – Leos313 Oct 15 '19 at 16:00
  • 1
    I'm voting to close this question as off-topic because [Can I ask questions about installation in SO?](https://meta.stackoverflow.com/questions/338203/can-i-ask-questions-about-installation-in-so) Software tools commonly used by programmers and is **a practical, answerable problem that is unique to software development.** – Trenton McKinney Oct 15 '19 at 18:07
  • @TrentonMcKinney, should I delete the question? – Leos313 Oct 16 '19 at 07:47
  • That's up to you. I doubt it will get a useful answer and it's probably going to be closed. – Trenton McKinney Oct 16 '19 at 14:17

2 Answers2

4

Building on sinoroc's answer: PyQt4 is outdated, and only PyQt6 or PyQt5 are available on PIP. See this website.

pip install PyQt6
cmaer1
  • 106
  • 5
3

By default pip looks for project distributions on Pypi. If you ask for pip install PyQt4, then you can also manually look at the page for this PyQt4 project on PyPi. There you will eventually see that there are no distributions at all to download so pip won't be able to install anything on any platform for any Python version at all. You need to look for alternatives.

You can have a look at the homepage of the PyQt project and you will eventually find the page to download the PyQt4 source code. There is a link on this page for the Linux source code of PyQt4, so you might want to have a look at it and see if you can get it installed on your system.

sinoroc
  • 18,409
  • 2
  • 39
  • 70