1

I tried installing PyQt5==5.15.6 and this error keeps showing repeatedly:

Collecting PyQt5==5.15.6 (from -r requirements.txt (line 6)) Using cached https://files.pythonhosted.org/packages/3b/27/fd81188a35f37be9b3b4c2db1654d9439d1418823916fe702ac3658c9c41/PyQt5-5.15.6.tar.gz Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... error ERROR: Command errored out with exit status 1: command: 'c:\users\clens\appdata\local\programs\python\python38\python.exe' 'c:\users\clens\appdata\local\programs\python\python38\lib\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\clens\AppData\Local\Temp\tmpf4m7pu7d' cwd: C:\Users\clens\AppData\Local\Temp\pip-install-71rwmvce\PyQt5 Complete output (31 lines): Traceback (most recent call last): File "c:\users\clens\appdata\local\programs\python\python38\lib\site-packages\pip_vendor\pep517_in_process.py", line 64, 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:\users\clens\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 207, in <module>
    main()
  File "c:\users\clens\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 197, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "c:\users\clens\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 66, in prepare_metadata_for_build_wheel
    return _get_wheel_metadata_from_wheel(backend, metadata_directory,
  File "c:\users\clens\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 95, in _get_wheel_metadata_from_wheel
    whl_basename = backend.build_wheel(metadata_directory, config_settings)
  File "C:\Users\clens\AppData\Local\Temp\pip-build-env-12b0td49\overlay\Lib\site-packages\sipbuild\api.py", line 46, in build_wheel
    project = AbstractProject.bootstrap('wheel',
  File "C:\Users\clens\AppData\Local\Temp\pip-build-env-12b0td49\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 87, in bootstrap
    project.setup(pyproject, tool, tool_description)
  File "C:\Users\clens\AppData\Local\Temp\pip-build-env-12b0td49\overlay\Lib\site-packages\sipbuild\project.py", line 585, in setup
    self.apply_user_defaults(tool)
  File "project.py", line 63, in apply_user_defaults
    super().apply_user_defaults(tool)
  File "C:\Users\clens\AppData\Local\Temp\pip-build-env-12b0td49\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
    super().apply_user_defaults(tool)
  File "C:\Users\clens\AppData\Local\Temp\pip-build-env-12b0td49\overlay\Lib\site-packages\sipbuild\project.py", line 236, in apply_user_defaults
    self.builder.apply_user_defaults(tool)
  File "C:\Users\clens\AppData\Local\Temp\pip-build-env-12b0td49\overlay\Lib\site-packages\pyqtbuild\builder.py", line 69, in apply_user_defaults
    raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
----------------------------------------

ERROR: Command errored out with exit status 1: 'c:\users\clens\appdata\local\programs\python\python38\python.exe' 'c:\users\clens\appdata\local\programs\python\python38\lib\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\clens\AppData\Local\Temp\tmpf4m7pu7d' Check the logs for full command output.

I was trying to install requirements file with the command pip install -r requirements.txt but this error keeps coming up

Wanda Dach
  • 11
  • 1
  • Try this version instead `pip install PyQt5==5.15.2` instead `5.15.6` More debugging steps here -->https://stackoverflow.com/questions/65447314/attributeerror-module-sipbuild-api-has-no-attribute-prepare-metadata-for-bui – Bhargav - Retarded Skills Dec 11 '22 at 13:44

1 Answers1

0

I had the same problem and finally got it working by simply downgrading to Python 3.9.13. It must not be implemented in Python 3.11 yet. None of the suggested answers in previous threads worked for me (upgrading pip or specifying any pyqt version).

To downgrade Python,

  • Install virtualenv (pip install virtualenv)
  • Download a previous Python release on the official website (do not add to path!)
  • Create a virtualenv using the newly installed Python version: virtualenv path\to\virtualenv -p path\to\new\python.exe
  • Activate the virtualenv: path\to\virtualenv\Scripts\Activate

Then, reinstall pyqt5 and pyqt5-tools with pip (in this active virtualenv), and it should work.

Ethalides
  • 17
  • 4