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

Phil Thompson phil at riverbankcomputing.com
Sun Jan 17 10:19:09 GMT 2021


On 17/01/2021 01: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'
> 
> 
> I use pyenv to juggle around with different python versions. The
> versions of pip, wheel and setuptools used by poetry are all up to
> date. No error occurs if I enter the virtualenv shell and manually call
> `pip install pyqt6`.
> 
> From what I can gather it is failing due to the way those tools
> install packages, they are using the `--no-deps` argument which prevent
> SIP6 from being installed beforehand. It is, presumably, because they
> handle dependencies resolution themselves. That behavior can be
> reproduced manually, and a work around the error would be to install
> SIP first, then PyQt6. However the tools (pipenv and poetry) do not
> seem to be able to handle that process. Yet calling `poetry run pip
> install pyqt6` goes fine.
> 
> I don't know how to solve this issue, nor if it lies with pyqt6 or with
> the third party tools.
> 
> Any help or insight on this conundrum would be greatly appreciated.

PEP 517 states that 'prepare_metadata_for_build_wheel' is an optional 
hook and specifies what the frontend should do if the backend doesn't 
provide it.

Phil


More information about the PyQt mailing list