Unable to install PyQt6 using third party helpers (poetry, pipenv)

Kyle Altendorf sda at fstab.net
Sun Jan 17 14:26:48 GMT 2021



On 2021-01-16 20:37, Ludovic Bellière wrote:
> Hi,
> 
> I spent the last couple of hours trying to migrate one of my project to
> PyQt6, however it seems that I have encountered some issues that are
> beyond my understanding. PyQt6 seems to install fine when using
> pip directly, however whenever I use pipenv or poetry, it fails with
> the following error:
> 
>> Command ['/home/xx/.cache/pypoetry/virtualenvs/xx-_xx-py3.8/bin/pip', 
>> 'install', '--no-deps', 
>> '/home/xx/.cache/pypoetry/artifacts/9f/e5/4f/8c942b1b7e85a41e4f60f423ebcf98c81e6ce31c589eaa9f186c9e878e/PyQt6-6.0.0.tar.gz'] 
>> errored with the following return code 1, and output
>> ...
>> ERROR: Command errored out with exit status 1:
>>  command: /home/xx/.cache/pypoetry/virtualenvs/xx-_xx-py3.8/bin/python 
>> /home/xx/.cache/pypoetry/virtualenvs/xx-_xx-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py
>> prepare_metadata_for_build_wheel /tmp/tmpk1sn4iki
>>      cwd: /tmp/pip-req-build-ml08pgo8
>> Complete output (26 lines):
>> Querying qmake about your Qt installation...
>> /usr/bin/qmake -query
>> Traceback (most recent call last):
>>   File 
>> "/home/xx/.cache/pypoetry/virtualenvs/xx-_xx-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", 
>> line 126, 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'

The error looks to be in the `pep517` package but the copy vendored by 
`pip`.  It appears that even there they have had an `except 
AttributeError:` since `pep517` was vendored.

https://github.com/pypa/pip/blame/7b7469b8454be1c0f968957e93ae23264187ee41/src/pip/_vendor/pep517/_in_process.py#L126

So I guess check your pip version, check that file referenced in the 
traceback vs. the pip on github etc...  maybe share that code here or 
you could ask in #python on Freenode's IRC servers.  The majority of 
packages don't have custom backends and just use setuptools so it isn't 
particularly surprising that you don't see any issue with other 
packages.

For completeness, here is the definition of 
`prepare_metadata_for_build_wheel` in the optional section in PEP 517.

https://www.python.org/dev/peps/pep-0517/#prepare-metadata-for-build-wheel

Cheers,
-kyle


More information about the PyQt mailing list