下载Pyqt5时下载。但是当我尝试下载Pyqt5工具时,我遇到了一个错误。
我使用Windows 11
当使用Windows 10时,它很容易下载。但是Windows 11在安装之后还没有安装。
pip install pyqt5-toolsCollecting pyqt5-toolsUsing cached pyqt5_tools-5.15.4.3.2-py3-none-any.whl (29 kB)Requirement already satisfied: click in c:usersimranappdatalocalpackagespythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0localcachelocal-packagespython310site-packages (from pyqt5-tools) (8.1.2)Using cached pyqt5_tools-5.15.4.3.1-py3-none-any.whl (28 kB)Using cached pyqt5_tools-5.15.4.3.0.3-py3-none-any.whl (28 kB)Using cached pyqt5_tools-5.15.3.3.2-py3-none-any.whl (29 kB)Using cached pyqt5_tools-5.15.3.3.1-py3-none-any.whl (28 kB)Collecting pyqt5==5.15.3Using cached PyQt5-5.15.3.tar.gz (3.3 MB)Installing build dependencies ... doneGetting requirements to build wheel ... donePreparing metadata (pyproject.toml) ... errorerror: 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:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0libsite-packagespip_vendorpep517in_process_in_process.py", line 156, in prepare_metadata_for_build_wheelhook = backend.prepare_metadata_for_build_wheelAttributeError: 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:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0libsite-packagespip_vendorpep517in_process_in_process.py", line 363, in <module>
main()
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0libsite-packagespip_vendorpep517in_process_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0libsite-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:UsersimranAppDataLocalTemppip-build-env-mym69u8_overlayLibsite-packagessipbuildapi.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "C:UsersimranAppDataLocalTemppip-build-env-mym69u8_overlayLibsite-packagessipbuildabstract_project.py", line 83, in bootstrap
project.setup(pyproject, tool, tool_description)
File "C:UsersimranAppDataLocalTemppip-build-env-mym69u8_overlayLibsite-packagessipbuildproject.py", line 594, in setup
self.apply_user_defaults(tool)
File "C:UsersimranAppDataLocalTemppip-install-ebfgqguqpyqt5_e2d6632ee7174ad58d61d88e0ddffdcdproject.py", line 63, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:UsersimranAppDataLocalTemppip-build-env-mym69u8_overlayLibsite-packagespyqtbuildproject.py", line 70, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:UsersimranAppDataLocalTemppip-build-env-mym69u8_overlayLibsite-packagessipbuildproject.py", line 241, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "C:UsersimranAppDataLocalTemppip-build-env-mym69u8_overlayLibsite-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.
我在这里遇到了同样的问题。我安装了Python 3.10,但我发现Python 3.10版本不支持PyQt5。你可以在这里查看这些信息。
所以我降低了我的Python版本,一切都很好。