Failure in converting PyQt5 to PyQt6

ullix ullix at urkam.de
Mon Jan 13 09:04:24 GMT 2025


Thx, eventually I succeeded and thingds run well now.

One major headache was, that my font-formatting was severly broken. It 
turned out, the font-weight had been changed from 0...99 in PYQt5 to 
0...1000 in PyQt6. I discovered this only because of a typo of doing 
'999' when I wanted to do '999'. Quite annoying.

However, a user of my software now reports a major issue when installing 
PyQt6. Specifically with this command:

|$ __venv1.6.0pre23/bin/python-mpipinstallPyQt6==6.8.0|

He gets:

|Lookinginindexes:https://pypi.org/simple, 
https://www.piwheels.org/simple CollectingPyQt6==6.8.0 
UsingcachedPyQt6-6.8.0.tar.gz(1.1MB) Installingbuilddependencies...done 
Gettingrequirementstobuildwheel...done 
Preparingmetadata(pyproject.toml)...error 
error:subprocess-exited-with-error 
×Preparingmetadata(pyproject.toml)didnotrunsuccessfully. │exitcode:1 
╰─>[25linesofoutput] Traceback(mostrecentcalllast): 
File"/home/simon/geigerlog-v1.6.0pre23/__venv1.6.0pre23/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py",line353,in<module> 
main() 
File"/home/simon/geigerlog-v1.6.0pre23/__venv1.6.0pre23/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py",line335,inmain 
json_out['return_val']=hook(**hook_input['kwargs']) 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
File"/home/simon/geigerlog-v1.6.0pre23/__venv1.6.0pre23/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py",line152,inprepare_metadata_for_build_wheel 
whl_basename=backend.build_wheel(metadata_directory,config_settings) 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
File"/tmp/pip-build-env-83yh2byd/overlay/lib/python3.11/site-packages/sipbuild/api.py",line28,inbuild_wheel 
project=AbstractProject.bootstrap('wheel', 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
File"/tmp/pip-build-env-83yh2byd/overlay/lib/python3.11/site-packages/sipbuild/abstract_project.py",line74,inbootstrap 
project.setup(pyproject,tool,tool_description) 
File"/tmp/pip-build-env-83yh2byd/overlay/lib/python3.11/site-packages/sipbuild/project.py",line608,insetup 
self.apply_user_defaults(tool) 
File"/tmp/pip-install-4khavmaz/pyqt6_b63926ea03ba47aebf4a2cdbe97fc7e1/project.py",line66,inapply_user_defaults 
super().apply_user_defaults(tool) 
File"/tmp/pip-build-env-83yh2byd/overlay/lib/python3.11/site-packages/pyqtbuild/project.py",line51,inapply_user_defaults 
super().apply_user_defaults(tool) 
File"/tmp/pip-build-env-83yh2byd/overlay/lib/python3.11/site-packages/sipbuild/project.py",line237,inapply_user_defaults 
self.builder.apply_user_defaults(tool) 
File"/tmp/pip-build-env-83yh2byd/overlay/lib/python3.11/site-packages/pyqtbuild/builder.py",line49,inapply_user_defaults 
raisePyProjectOptionException('qmake', 
sipbuild.pyproject.PyProjectOptionException [endofoutput] 
note:Thiserrororiginatesfromasubprocess,andislikelynotaproblemwithpip. 
error:metadata-generation-failed 
×Encounterederrorwhilegeneratingpackagemetadata. ╰─>Seeaboveforoutput. 
note:Thisisanissuewiththepackagementionedabove,notpip. 
hint:Seeabovefordetails.|

Any ideas about the cause?

On my system this installaton runs fine (Linux Mint LMDE 6 (based on 
debian12, "bookworm") with Linux amd7 6.11.10+bpo-amd64 #1) on all 
Python3.11, 3.12, 3.13.

The user's system is |"Debian GNU/Linux 12 (bookworm)" with 
||Linuxrp4b6.6.62+rpt-rpi-v8#1SMPPREEMPTDebian1:6.6.62-1+rpt1(2024-11-25)aarch64GNU/Linux, 
using Python3.11|

|
|

|
|

Am 30.12.24 um 11:59 schrieb Dmitry Shachnev:
> Hi,
>
> On Mon, Dec 30, 2024 at 09:43:25AM +0100, ullix wrote:
>> A have a larger Python program, based on PyQt5, and running well on Linux,
>> Win, Mac. I tried to convert to PyQt6 and failed.
>>
>> I changed all "PyQt5" to "PyQt6", and used the tool from K.Mulier
>> (https://stackoverflow.com/a/72658216/6178507) to convert the enums, which -
>> so far- seemed to have worked ok.
>>
>> However, upon starting, the program crashes at the execution of:
>>
>> gapp = QApplication([])
>>
>> with the message:
>>
>> qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load
>> the Qt xcb platform plugin.
> Did you try installing the package which is mentioned in the error message?
>
> In Debian/Ubuntu, that would be the latter one, libxcb-cursor0.
>
> --
> Dmitry Shachnev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20250113/9d5436f2/attachment-0001.htm>


More information about the PyQt mailing list