PyQt5 is not recognized from python 3.8 installation in python 3.10

Mats Wichmann mats at wichmann.us
Sun Aug 22 18:55:28 EDT 2021


On 8/22/21 7:04 AM, Mohsen Owzar wrote:
> Hi guys,
> I have on my laptop the python installation 3.8 and newly I installed newest version 3.10 as well on my laptop.
> Now I have two IDLEs for both of the installations.
> When I rund some *.py file, having PyQt5 module, on the 3.8 version, it works as before without any problems.
> But whenn I run the same file on IDLE with 3.10 installation, it crashes and says that PyQt5 is not known.
> 
> I tried to install this package with"pip install pyqt5" or with "py -3 -m pip install pyqt5", it brings lots of error messages (long long) as the lines below (they are only the beginning of the messages):

make sure you're getting the right Python by doing

py -3.10 -m pip install pyqt5

(the fact you're getting the build error below indicates you _are_ 
getting the right one, but it's good to be explicit anyway, just so 
you're sure).

> ==================================================
> C:\Users\Mohsen>py -3 -m pip install pyqt5
> Collecting pyqt5
>    Using cached PyQt5-5.15.4.tar.gz (3.3 MB)
>    Installing build dependencies ... done
>    Getting requirements to build wheel ... done
>      Preparing wheel metadata ... error
>      ERROR: Command errored out with exit status 1:
>       command: 'C:\Users\Mohsen\AppData\Local\Programs\Python\Python310\python.exe' 'C:\Users\Mohsen\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\Mohsen\AppData\Local\Temp\tmprax0esmt'
>           cwd: C:\Users\Mohsen\AppData\Local\Temp\pip-install-wl_b58e9\pyqt5_1cbd1bab46fa4abaad34b55514561ce6
>      Complete output (33 lines):
>      Querying qmake about your Qt installation...
>      C:\Qt\4.7.4\bin\qmake.exe -query
>      Traceback (most recent call last):
>        File "C:\Users\Mohsen\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 143, in prepare_metadata_for_build_wheel
>          hook = backend.prepare_metadata_for_build_wheel
>      AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

Your problem here is that there's no released binary wheel for PyQt5, 
since Py 3.10 isn't released (there's been some recent chatter about 
encouraging projects to make builds for new Python versions available 
early, e.g. once a Python version hits release candidate state, but 
that's just that - chatter - for now).

In theory your system should be able to build it, but my experience is 
that unless you're an active Python developer on Windows and already 
have the right working setup, it pretty much always fails.  These are 
the perils of trying to use a pre-release...

That error suggests there's something different going on than usual 
(which has to do with the MSVC compiler suite not being set up the way 
the package expects): there looks like a version mismatch - it looks 
like it's finding qmake for Qt4, not Qt5.  Maybe you can make some 
progress by adjusting some paths?

Many people go here to get early-access, albeit unofficial, binary wheels:

https://www.lfd.uci.edu/~gohlke/pythonlibs

Unfortunately, PyQt5 is not available from there (as listed in the 
section at the very bottom)




More information about the Python-list mailing list