我想用PyQt 6创建我的小GUI应用程序。我已经安装了PyQt 6,但是我还必须安装PyQt 6-tools。所以,当我试图获得它时,我得到了这个错误:
C:\Users\egorl>pip install pyqt6-tools
Collecting pyqt6-tools
Using cached pyqt6_tools-6.1.0.3.2-py3-none-any.whl (29 kB)
Using cached pyqt6_tools-6.0.3.3.2-py3-none-any.whl (29 kB)
Using cached pyqt6_tools-6.0.2.3.2-py3-none-any.whl (29 kB)
Collecting pyqt6==6.0.2
Using cached PyQt6-6.0.2.tar.gz (940 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\egorl\AppData\Local\Programs\Python\Python310\python.exe' 'C:\Users\egorl\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\egorl\AppData\Local\Temp\tmpjhw74rau'
cwd: C:\Users\egorl\AppData\Local\Temp\pip-install-yqby2el1\pyqt6_1bb69b3deb294f56858c9f93a5b67097
Complete output (29 lines):
Traceback (most recent call last):
File "C:\Users\egorl\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\egorl\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\Users\egorl\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\egorl\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\egorl\AppData\Local\Temp\pip-build-env-4moc33ew\overlay\Lib\site-packages\sipbuild\api.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "C:\Users\egorl\AppData\Local\Temp\pip-build-env-4moc33ew\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 83, in bootstrap
project.setup(pyproject, tool, tool_description)
File "C:\Users\egorl\AppData\Local\Temp\pip-build-env-4moc33ew\overlay\Lib\site-packages\sipbuild\project.py", line 587, in setup
self.apply_user_defaults(tool)
File "C:\Users\egorl\AppData\Local\Temp\pip-install-yqby2el1\pyqt6_1bb69b3deb294f56858c9f93a5b67097\project.py", line 60, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\egorl\AppData\Local\Temp\pip-build-env-4moc33ew\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\egorl\AppData\Local\Temp\pip-build-env-4moc33ew\overlay\Lib\site-packages\sipbuild\project.py", line 234, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "C:\Users\egorl\AppData\Local\Temp\pip-build-env-4moc33ew\overlay\Lib\site-packages\pyqtbuild\builder.py", line 67, in apply_user_defaults
raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/80/2a/70619beeebc44e0d554beaed5c6687e55d8c284d8f0fa0eeb66372ce15d0/PyQt6-6.0.2.tar.gz#sha256=aab1b58e287cd8c91d7f7b8c4f91d68b8980f07fcd2ad6d9adbf0bb75347fb9a (from https://pypi.org/simple/pyqt6/) (requires-python:>=3.6.1). Command errored out with exit status 1: 'C:\Users\egorl\AppData\Local\Programs\Python\Python310\python.exe' 'C:\Users\egorl\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\egorl\AppData\Local\Temp\tmpjhw74rau' Check the logs for full command output.
Collecting pyqt6-tools
Using cached pyqt6_tools-6.0.1.3.2-py3-none-any.whl (29 kB)
Collecting pyqt6==6.0.1
Using cached PyQt6-6.0.1.tar.gz (940 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\egorl\AppData\Local\Programs\Python\Python310\python.exe' 'C:\Users\egorl\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\egorl\AppData\Local\Temp\tmpmzbc3d1o'
cwd: C:\Users\egorl\AppData\Local\Temp\pip-install-yqby2el1\pyqt6_271acbd829354c02a24c2e3326134647
Complete output (29 lines):
Traceback (most recent call last):
File "C:\Users\egorl\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\egorl\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\Users\egorl\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\egorl\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\egorl\AppData\Local\Temp\pip-build-env-hk2owijm\overlay\Lib\site-packages\sipbuild\api.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "C:\Users\egorl\AppData\Local\Temp\pip-build-env-hk2owijm\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 83, in bootstrap
project.setup(pyproject, tool, tool_description)
File "C:\Users\egorl\AppData\Local\Temp\pip-build-env-hk2owijm\overlay\Lib\site-packages\sipbuild\project.py", line 587, in setup
self.apply_user_defaults(tool)
File "C:\Users\egorl\AppData\Local\Temp\pip-install-yqby2el1\pyqt6_271acbd829354c02a24c2e3326134647\project.py", line 61, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\egorl\AppData\Local\Temp\pip-build-env-hk2owijm\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\egorl\AppData\Local\Temp\pip-build-env-hk2owijm\overlay\Lib\site-packages\sipbuild\project.py", line 234, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "C:\Users\egorl\AppData\Local\Temp\pip-build-env-hk2owijm\overlay\Lib\site-packages\pyqtbuild\builder.py", line 67, in apply_user_defaults
raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/f9/29/db2cb373ceac78c829def458fdfe72a637ed991d65f4e026997db5f3f200/PyQt6-6.0.1.tar.gz#sha256=313f0f4bf0158e7ce3b892f1ec16b3378e505e0f2458394c1245eb6807695c0d (from https://pypi.org/simple/pyqt6/) (requires-python:>=3.6.1). Command errored out with exit status 1: 'C:\Users\egorl\AppData\Local\Programs\Python\Python310\python.exe' 'C:\Users\egorl\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\egorl\AppData\Local\Temp\tmpmzbc3d1o' Check the logs for full command output.
ERROR: Cannot install pyqt6-tools==6.0.1.3.2, pyqt6-tools==6.0.2.3.2, pyqt6-tools==6.0.3.3.2 and pyqt6-tools==6.1.0.3.2 because these package versions have conflicting dependencies.
The conflict is caused by:
pyqt6-tools 6.1.0.3.2 depends on pyqt6-plugins<6.1.0.3 and >=6.1.0.2.2
pyqt6-tools 6.0.3.3.2 depends on pyqt6-plugins<6.0.3.3 and >=6.0.3.2.2
pyqt6-tools 6.0.2.3.2 depends on pyqt6==6.0.2
pyqt6-tools 6.0.1.3.2 depends on pyqt6==6.0.1
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
我知道,依赖关系有问题,但是我没有任何pip方面的经验,所以我不知道如何解决这个问题。OS:Windows 10操作系统、Python 3.10
3条答案
按热度按时间mznpcxlj1#
有同样的错误与python 3. 10,但不想给予,并恢复到旧版本3. 9安装的设计师分别从https://build-system.fman.io/qt-designer-download它的一个小和快速安装。
qjp7pelc2#
正如eyllanesc所建议的,使用python3.9对我来说很有效。
<PathToPython3.9>\python.exe -m pip安装pyqt 6工具
k4aesqcs3#
对于那些使用Linux(我是Ubuntu)并且不想恢复到Python 3.9的人,使用以下方法:
1.如果没有flatpak,请安装
sudo apt install flatpak
1.添加Flatpak存储库:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
1.安装Qt设计器:
flatpak install flathub io.qt.Designer
1.安装完成后:在终端中运行
designer
。您可以在以下网站上找到更多信息:https://flathub.org/apps/details/io.qt.Designer