Unable to install PyQt6 using third party helpers (poetry, pipenv)
Phil Thompson
phil at riverbankcomputing.com
Sun Jan 17 16:53:02 GMT 2021
On 17/01/2021 16:36, Ludovic Bellière wrote:
> Thanks for the answer, with both your and kyle's hints I believe I have
> narrowed the source of the issue. However I need to ask for forgiveness
> as more information was available to my end but I didn't deem it
> necessary to share — being tired leads you down a thorny path.
>
> pip tries to fallback on [`_get_wheel_metadata_from_wheel`][1] since
> `prepare_metadata_for_build_wheel` isn't available in sipbuild, as you
> hinted. The fallback behavior tries to gather information from the
> wheel.
>
> The resulting traceback shows sipbuild failing, or more specifically,
> PyQt6's project.py bailing because of a wrong version of Qt.
>
>> Traceback (most recent call last):
>> File
>> "/home/xx/.cache/pypoetry/virtualenvs/xx-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py",
>> line 280, in <module>
>> main()
>> File
>> "/home/xx/.cache/pypoetry/virtualenvs/xx-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py",
>> line 263, in main
>> json_out['return_val'] = hook(**hook_input['kwargs'])
>> File
>> "/home/xx/.cache/pypoetry/virtualenvs/xx-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py",
>> line 130, in prepare_metadata_for_build_wheel
>> return _get_wheel_metadata_from_wheel(backend, metadata_directory,
>> File
>> "/home/xx/.cache/pypoetry/virtualenvs/xx-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py",
>> line 159, in _get_wheel_metadata_from_wheel
>> whl_basename = backend.build_wheel(metadata_directory,
>> config_settings)
>> File
>> "/tmp/pip-build-env-dkujrq7f/overlay/lib/python3.8/site-packages/sipbuild/api.py",
>> line 51, in build_wheel
>> project = AbstractProject.bootstrap('pep517')
>> File
>> "/tmp/pip-build-env-dkujrq7f/overlay/lib/python3.8/site-packages/sipbuild/abstract_project.py",
>> line 83, in bootstrap
>> project.setup(pyproject, tool, tool_description)
>> File
>> "/tmp/pip-build-env-dkujrq7f/overlay/lib/python3.8/site-packages/sipbuild/project.py",
>> line 495, in setup
>> self.update(tool)
>> File "project.py", line 158, in update
>> sipbuild.exceptions.UserException
>
> The hints are in my first email's traceback. The build process is
> calling my system's qmake to get Qt's information, which at first
> sight doesn't make sense. However that's where my understanding of the
> process completely disintegrate.
My guess would be that the vendor version of pip in poetry is too old
and doesn't understand contemporary wheel tags. It therefore tries to
build PyQt from source which will only work if you have Qt's bin
directory on PATH.
There is a fundamental bug in PEP 517 in that backends have no mechanism
of reporting errors in a user-friendly way. Also pip's support for PEP
517 isn't very good when it comes to allowing the user to pass
configuration options to the backend.
Phil
More information about the PyQt
mailing list