在Ubuntu 18.04上尝试在PyCharm上安装PyQt5软件包时收到错误

时间:2020-01-30 08:19:01

标签: python pycharm pyqt5

当尝试在PyCharm CE中下载PyQt5软件包时,我收到:

“ AttributeError:模块'sipbuild.api'没有属性'prepare_metadata_for_build_wheel'”

我还附上了错误和命令输出的屏幕截图。

Screenshot of error window

命令输出:

  Using cached https://files.pythonhosted.org/packages/3a/fb/eb51731f2dc7c22d8e1a63ba88fb702727b324c6352183a32f27f73b8116/PyQt5-5.14.1.tar.gz
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'error'
    Complete output from command /home/justin/PycharmProjects/GUI_Development/venv/bin/python /home/justin/PycharmProjects/GUI_Development/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmporuyriae:
    Querying qmake about your Qt installation...
    /usr/bin/qmake -query
    Traceback (most recent call last):
      File "/home/justin/PycharmProjects/GUI_Development/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/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/justin/PycharmProjects/GUI_Development/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/pep517/_in_process.py", line 207, in <module>
        main()
      File "/home/justin/PycharmProjects/GUI_Development/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/pep517/_in_process.py", line 197, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/home/justin/PycharmProjects/GUI_Development/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/pep517/_in_process.py", line 67, in prepare_metadata_for_build_wheel
        config_settings)
      File "/home/justin/PycharmProjects/GUI_Development/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/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-94g23xpj/overlay/lib/python3.6/site-packages/sipbuild/api.py", line 51, in build_wheel
        project = AbstractProject.bootstrap('pep517')
      File "/tmp/pip-build-env-94g23xpj/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-94g23xpj/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-94g23xpj/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-94g23xpj/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-94g23xpj/overlay/lib/python3.6/site-packages/pyqtbuild/builder.py", line 76, in apply_user_defaults
        self._get_qt_configuration()
      File "/tmp/pip-build-env-94g23xpj/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-94g23xpj/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

    ----------------------------------------

Command "/home/justin/PycharmProjects/GUI_Development/venv/bin/python /home/justin/PycharmProjects/GUI_Development/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmporuyriae" failed with error code 1 in /tmp/pycharm-packaging/PyQt5

1 个答案:

答案 0 :(得分:-5)

编辑:基于表明错误的点子版本的错误,建议不要确定是否正确。重复的问题将为以后的观看者提供一个更好的解决方案。

Use pip3 for packages for python 3.*