PyQt5 is not recognized from python 3.8 installation in python 3.10

Mohsen Owzar mohsen.owzar at gmail.com
Tue Aug 24 01:06:44 EDT 2021


Barry schrieb am Dienstag, 24. August 2021 um 00:25:38 UTC+2:
> > On 23 Aug 2021, at 00:00, Mats Wichmann <ma... at wichmann.us> wrote:
> > 
> > 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?
> Only trivial C code extensions can be built on windows. 
> And then only if you have the right MSVC tools installed. 
> Most interesting extensions have dependencies only other software. 
> Which means that you need to know how to build all the dependencies as well. 
> 
> For something as complex as PyQt5 you need to be a developer with reasonable experience to build it. 
> 
> Check on PyPI for the available versions and install one of them. 
> 
> Barry
> > 
> > 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) 
> > 
> >
> > -- 
> > https://mail.python.org/mailman/listinfo/python-list 
> >
Thanks a lot for your answers.
That's true. I had a project which used Qt4.7, and I have still on my laptop.
I have not so big knowledge about compiling and building stuff, so I have to get rid of 3.10 version.
OK, then I try to remove Python 3.10 and to install 3.9.6.
Best regards
Mohsen


More information about the Python-list mailing list