J A S K I E R
J A S K I E R

Reputation: 2184

Python on Mac OS; No matching distribution found for PyQt5

  1. In cause of conflicting PyQt5 and PyQt4 I deleted both from folders, and now trying to make my script run.

    ./labelImg.py 
    

Traceback (most recent call last): File "./labelImg.py", line 24, in from PyQt4.QtGui import * ImportError: No module named PyQt4.QtGui

  1. Tried to install PyQt4 by "pip install pyqt":

Collecting pyqt

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

  1. Tried to check pip :

    which pip
    

All is fine. The same "which" for PyQt4 has no result at all... just passed by...

Upvotes: 0

Views: 2405

Answers (2)

J A S K I E R
J A S K I E R

Reputation: 2184

Tried everything ... every single pip, python version, modules ...

My decision was to reinstall Mac OS and use only necessary files to launch what I need. So there is very less information about general concept Mac OS and Python. As I figured out ...

  1. There is package installation. (By mouse and finder).

  2. Homebrew installation (environment wich isolates you libraries and modules for python. More safer and can be restored with git repo. (Terminal)

  3. custom configuration with own paths.

There are a lot of guides how to to it, but the main point is to use only one method. Moreover I had some:

ImportError: No module named PyQt4.QtCore

We can fix it by changing .py file and put there PyQt5 i.e. However, if you have updated everything, and it doesn't work, try to call

Python3 your_script.py

Good luck guys!

Upvotes: 0

BlackJack
BlackJack

Reputation: 4679

First there is no need to delete PyQt4 or PyQt5 because there is not conflict. Both can be installed and coexist, they have different module/package names after all.

And those package names are also the names of the packages in the Python Package Index, not pyqt, but PyQt4 and PyQt5 (PyPI search for „pyqt“).

Upvotes: 1

Related Questions