'I am trying to install PyQt6 and am getting metadata error

New to Python. Attempting to install PyQt6. This is my error. Any suggestions?

Preparing metadata (pyproject.toml) ... error
 error: subprocess-exited-with-error

 × Preparing metadata (pyproject.toml) did not run successfully.
 │ exit code: 1
 ╰─> [29 lines of output]
     Traceback (most recent call last):
       File "c:\python37-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 156, 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'

     During handling of the above exception, another exception occurred:

     Traceback (most recent call last):
       File "c:\python37-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
         main()
       File "c:\python37-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
         json_out['return_val'] = hook(**hook_input['kwargs'])
       File "c:\python37-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 160, in prepare_metadata_for_build_wheel
         whl_basename = backend.build_wheel(metadata_directory, config_settings)
       File "C:\Users\AFEANA~1.BRC\AppData\Local\Temp\pip-build-env-t089xght\overlay\Lib\site-packages\sipbuild\api.py", line 51, in build_wheel
         project = AbstractProject.bootstrap('pep517')
       File "C:\Users\AFEANA~1.BRC\AppData\Local\Temp\pip-build-env-t089xght\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 83, in bootstrap
         project.setup(pyproject, tool, tool_description)
       File "C:\Users\AFEANA~1.BRC\AppData\Local\Temp\pip-build-env-t089xght\overlay\Lib\site-packages\sipbuild\project.py", line 594, in setup
         self.apply_user_defaults(tool)
       File "project.py", line 67, in apply_user_defaults
         super().apply_user_defaults(tool)
       File "C:\Users\AFEANA~1.BRC\AppData\Local\Temp\pip-build-env-t089xght\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
         super().apply_user_defaults(tool)
       File "C:\Users\AFEANA~1.BRC\AppData\Local\Temp\pip-build-env-t089xght\overlay\Lib\site-packages\sipbuild\project.py", line 241, in apply_user_defaults
         self.builder.apply_user_defaults(tool)
       File "C:\Users\AFEANA~1.BRC\AppData\Local\Temp\pip-build-env-t089xght\overlay\Lib\site-packages\pyqtbuild\builder.py", line 68, in apply_user_defaults
         "specify a working qmake or add it to PATH")
     sipbuild.pyproject.PyProjectOptionException
     [end of output]

I had similar issues with my home system and got it figured out. The work system is using PyCharm. On my home system I needed to go into the PyCharm folder and run in venv. I am unable to do that here at work. So I am giving up and just sticking to PyQt5 here. Thanks.



Solution 1:[1]

What version of python did you install? Because i had the same problem and for me the update to a recent version of python (3.9 to 3.10) have solved the problem

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Elisa Simoni