我是python领域的新手,我希望您能为我的PyQt5安装问题提供帮助。 我尝试使用终端在ubuntu 18.04机器上安装pyqt5。 我已经尝试了所有建议,但根本无法解决。
pip3 install --user pyqt5
我遇到了这个错误。
Collecting pyqt5
Using cached https://files.pythonhosted.org/packages/3a/fb/eb51731f2dc7c22d8e1a63ba88fb702727b324c6352183a32f27f73b8116/PyQt5-5.14.1.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Complete output from command /usr/bin/python /home/jcreigns/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpw7wu80bm:
ERROR: Querying qmake about your Qt installation...
/usr/bin/qmake -query
Traceback (most recent call last):
File "/home/jcreigns/.local/lib/python3.6/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 "/home/jcreigns/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
main()
File "/home/jcreigns/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/jcreigns/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 67, in prepare_metadata_for_build_wheel
config_settings)
File "/home/jcreigns/.local/lib/python3.6/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 "/tmp/pip-build-env-giguc0l7/overlay/lib/python3.6/site-packages/sipbuild/api.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "/tmp/pip-build-env-giguc0l7/overlay/lib/python3.6/site-packages/sipbuild/abstract_project.py", line 82, in bootstrap
project.setup(pyproject, tool, tool_description)
File "/tmp/pip-build-env-giguc0l7/overlay/lib/python3.6/site-packages/sipbuild/project.py", line 387, in setup
self.apply_user_defaults(tool)
File "project.py", line 62, in apply_user_defaults
super().apply_user_defaults(tool)
File "/tmp/pip-build-env-giguc0l7/overlay/lib/python3.6/site-packages/pyqtbuild/project.py", line 86, in apply_user_defaults
super().apply_user_defaults(tool)
File "/tmp/pip-build-env-giguc0l7/overlay/lib/python3.6/site-packages/sipbuild/project.py", line 202, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "/tmp/pip-build-env-giguc0l7/overlay/lib/python3.6/site-packages/pyqtbuild/builder.py", line 76, in apply_user_defaults
self._get_qt_configuration()
File "/tmp/pip-build-env-giguc0l7/overlay/lib/python3.6/site-packages/pyqtbuild/builder.py", line 431, in _get_qt_configuration
for line in project.read_command_pipe([self.qmake, '-query']):
File "/tmp/pip-build-env-giguc0l7/overlay/lib/python3.6/site-packages/sipbuild/project.py", line 350, in read_command_pipe
raise UserException("'{0}' failed returning {1}".format(cmd, rc))
sipbuild.exceptions.UserException
----------------------------------------
ERROR: Command "/usr/bin/python /home/jcreigns/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpw7wu80bm" failed with error code 1 in /tmp/pip-install-rqrr5o_m/pyqt5