AttributeError:模块 'sipbuild.api' 没有 PyQt5 5.15.0 的属性 'prepare_metadata_for_build_wheel'

2022-01-12 00:00:00 python python-3.x pip pyqt5

问题描述

我尝试安装的程序需要安装 PyQt5 5.15.0 ,这给了我这个错误.奇怪的是,最新版本的 PyQt5 (5.15.2) 可以正常安装,但是这个程序特别需要 5.15.0.

A program I am trying to install requires the installation of PyQt5 5.15.0 , which gives me this error. The odd thing is that the installation works fine for the latest version of PyQt5 (5.15.2), but this program requires 5.15.0 specifically.

命令输出:

Collecting PyQt5==5.15.0
  Using cached PyQt5-5.15.0.tar.gz (3.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:usersmshalappdatalocalprogramspythonpython39python.exe' 'C:UsersmshalAppDataRoamingPythonPython39site-packagespip\_vendorpep517\_in_process.py' prepare_metadata_for_build_wheel 'C:UsersmshalAppDataLocalTemp	mp41s11ev6'
         cwd: C:UsersmshalAppDataLocalTemppip-install-sfw90hvcpyqt5_e2cc46859b554da7b84798abae5378ba
    Complete output (31 lines):
    Traceback (most recent call last):
      File "C:UsersmshalAppDataRoamingPythonPython39site-packagespip\_vendorpep517\_in_process.py", line 126, 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:UsersmshalAppDataRoamingPythonPython39site-packagespip\_vendorpep517\_in_process.py", line 280, in <module>
        main()
      File "C:UsersmshalAppDataRoamingPythonPython39site-packagespip\_vendorpep517\_in_process.py", line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "C:UsersmshalAppDataRoamingPythonPython39site-packagespip\_vendorpep517\_in_process.py", line 130, in prepare_metadata_for_build_wheel
        return _get_wheel_metadata_from_wheel(backend, metadata_directory,
      File "C:UsersmshalAppDataRoamingPythonPython39site-packagespip\_vendorpep517\_in_process.py", line 159, in _get_wheel_metadata_from_wheel
        whl_basename = backend.build_wheel(metadata_directory, config_settings)
      File "C:UsersmshalAppDataLocalTemppip-build-env-nnx_yu09overlayLibsite-packagessipbuildapi.py", line 51, in build_wheel
        project = AbstractProject.bootstrap('pep517')
      File "C:UsersmshalAppDataLocalTemppip-build-env-nnx_yu09overlayLibsite-packagessipbuildabstract_project.py", line 83, in bootstrap
        project.setup(pyproject, tool, tool_description)
      File "C:UsersmshalAppDataLocalTemppip-build-env-nnx_yu09overlayLibsite-packagessipbuildproject.py", line 479, in setup
        self.apply_user_defaults(tool)
      File "project.py", line 62, in apply_user_defaults
        super().apply_user_defaults(tool)
      File "C:UsersmshalAppDataLocalTemppip-build-env-nnx_yu09overlayLibsite-packagespyqtbuildproject.py", line 79, in apply_user_defaults
        super().apply_user_defaults(tool)
      File "C:UsersmshalAppDataLocalTemppip-build-env-nnx_yu09overlayLibsite-packagessipbuildproject.py", line 225, in apply_user_defaults
        self.builder.apply_user_defaults(tool)
      File "C:UsersmshalAppDataLocalTemppip-build-env-nnx_yu09overlayLibsite-packagespyqtbuilduilder.py", line 66, in apply_user_defaults
        raise PyProjectOptionException('qmake',
    sipbuild.pyproject.PyProjectOptionException
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:usersmshalappdatalocalprogramspythonpython39python.exe' 'C:UsersmshalAppDataRoamingPythonPython39site-packagespip\_vendorpep517\_in_process.py' prepare_metadata_for_build_wheel 'C:UsersmshalAppDataLocalTemp	mp41s11ev6' Check the logs for full command output.

我使用的是最新版本的 pip.关于这个问题的根本原因的任何想法?

I am on the latest version of pip. Any ideas on the root cause of this issue?


解决方案

帮助我将 pip 从 20.2.3 升级到最新版本(在我的例子中是 21.1.1)

What helped me is upgrading pip from 20.2.3 to the latest one (in my case 21.1.1)

相关文章