安装pyqt工具时出现安装错误



我正在尝试安装PyQt6,在我的cmd中,当我运行pip install pyqt6时,它运行良好,但当我尝试安装pip install pyqt-tools时,它显示以下错误:

C:Userslenovo>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:UserslenovoAppDataLocalProgramsPythonPython310libsite-packagespip_vendorpep517in_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:UserslenovoAppDataLocalProgramsPythonPython310libsite-packagespip_vendorpep517in_process_in_process.py", line 363, in <module>
main()
File "C:UserslenovoAppDataLocalProgramsPythonPython310libsite-packagespip_vendorpep517in_process_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:UserslenovoAppDataLocalProgramsPythonPython310libsite-packagespip_vendorpep517in_process_in_process.py", line 160, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "C:UserslenovoAppDataLocalTemppip-build-env-omd2bkc3overlayLibsite-packagessipbuildapi.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "C:UserslenovoAppDataLocalTemppip-build-env-omd2bkc3overlayLibsite-packagessipbuildabstract_project.py", line 83, in bootstrap
project.setup(pyproject, tool, tool_description)
File "C:UserslenovoAppDataLocalTemppip-build-env-omd2bkc3overlayLibsite-packagessipbuildproject.py", line 594, in setup
self.apply_user_defaults(tool)
File "C:UserslenovoAppDataLocalTemppip-install-4y93vt9zpyqt6_e010daa9e104413b87d1d41abf25351dproject.py", line 60, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:UserslenovoAppDataLocalTemppip-build-env-omd2bkc3overlayLibsite-packagespyqtbuildproject.py", line 70, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:UserslenovoAppDataLocalTemppip-build-env-omd2bkc3overlayLibsite-packagessipbuildproject.py", line 241, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "C:UserslenovoAppDataLocalTemppip-build-env-omd2bkc3overlayLibsite-packagespyqtbuildbuilder.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.

我使用22.0.3 pip版本和3.10 python版本

在python包之前,似乎需要在操作系统上安装Qt6

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

路径更新是关键,因为构建器没有找到qmake需要的东西。

最新更新