2

I am trying to install PyQt6, in my cmd, when I run pip install pyqt6 its just works fine but when I try to install pip install pyqt-tools its shows this error:

C:\Users\lenovo>pip install pyqt6-tools
Collecting pyqt6-tools
  Using cached pyqt6_tools-6.1.0.3.2-py3-none-any.whl (29 kB)
Collecting python-dotenv
  Using cached python_dotenv-0.19.2-py2.py3-none-any.whl (17 kB)
Collecting pyqt6==6.1.0
  Using cached PyQt6-6.1.0.tar.gz (946 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  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:\Users\lenovo\AppData\Local\Programs\Python\Python310\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:\Users\lenovo\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
          main()
        File "C:\Users\lenovo\AppData\Local\Programs\Python\Python310\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:\Users\lenovo\AppData\Local\Programs\Python\Python310\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\lenovo\AppData\Local\Temp\pip-build-env-omd2bkc3\overlay\Lib\site-packages\sipbuild\api.py", line 51, in build_wheel
          project = AbstractProject.bootstrap('pep517')
        File "C:\Users\lenovo\AppData\Local\Temp\pip-build-env-omd2bkc3\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 83, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-build-env-omd2bkc3\overlay\Lib\site-packages\sipbuild\project.py", line 594, in setup
          self.apply_user_defaults(tool)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-4y93vt9z\pyqt6_e010daa9e104413b87d1d41abf25351d\project.py", line 60, in apply_user_defaults
          super().apply_user_defaults(tool)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-build-env-omd2bkc3\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
          super().apply_user_defaults(tool)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-build-env-omd2bkc3\overlay\Lib\site-packages\sipbuild\project.py", line 241, in apply_user_defaults
          self.builder.apply_user_defaults(tool)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-build-env-omd2bkc3\overlay\Lib\site-packages\pyqtbuild\builder.py", line 67, in apply_user_defaults
          raise PyProjectOptionException('qmake',
      sipbuild.pyproject.PyProjectOptionException
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I'm on 22.0.3 pip version and 3.10 python version

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Vansh Khera
  • 45
  • 1
  • 9
  • I think this is quite related question: https://stackoverflow.com/questions/65447314/attributeerror-module-sipbuild-api-has-no-attribute-prepare-metadata-for-bui – Blomex Feb 24 '22 at 10:50
  • uh, yes but that doesn't have have any answers – Vansh Khera Feb 24 '22 at 10:53
  • 2
    @VanshKhera pyqt-tools [does not support python-3.10](https://github.com/altendky/pyqt-tools/issues/98). You must use python-3.9 instead. – ekhumoro Feb 24 '22 at 17:58

1 Answers1

0

It seems like Qt6 needs to be installed on the OS before python package:

brew install pyqt5
export PATH="/opt/homebrew/opt/qt5/bin:$PATH"

The path update is the key as the builder is not finding something that the qmake needs.

zhrist
  • 1,169
  • 11
  • 28