当前位置:首页 > Python >

Preparing metadata (pyproject.toml) did not run successfully.

发布时间:2024-03-05 09:16:13 作者:佚名 阅读:(15)

在安装PyQt5-tools时,提示"Preparing metadata (pyproject.toml) did not run successfully"错误,这也就意味着在安装第三方包时出现了问题。这个错误可能由多种原因引起,例如网络连接问题、依赖项缺失、包版本不兼容等。接下来云梦编程为大家详细的介绍以下几种解决方法,有需要的小伙伴可以一下:

Preparing metadata (pyproject.toml) did not run successfully.

1、错误提示:

Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [26 lines of output]
      pyproject.toml: line 7: using '[tool.sip.metadata]' to specify the project metadata is deprecated and will be removed in SIP v7.0.0, use '[project]' instead
      Traceback (most recent call last):
        File "E:\Python\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "E:\Python\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "E:\Python\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 152, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\lenovo\AppData\Local\Temp\pip-build-env-9kw63mdv\overlay\Lib\site-packages\sipbuild\api.py", line 46, in build_wheel
          project = AbstractProject.bootstrap('wheel',
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\lenovo\AppData\Local\Temp\pip-build-env-9kw63mdv\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 92, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-build-env-9kw63mdv\overlay\Lib\site-packages\sipbuild\project.py", line 587, in setup
          self.apply_user_defaults(tool)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-893e8p97\pyqt5_0bc8f7f9cbc9489587a106272c085f21\project.py", line 63, in apply_user_defaults
          super().apply_user_defaults(tool)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-build-env-9kw63mdv\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
          super().apply_user_defaults(tool)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-build-env-9kw63mdv\overlay\Lib\site-packages\sipbuild\project.py", line 237, in apply_user_defaults
          self.builder.apply_user_defaults(tool)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-build-env-9kw63mdv\overlay\Lib\site-packages\pyqtbuild\builder.py", line 69, 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.

2、解决方法:

    (1)、检查网络连接:确保您的计算机可以正常访问互联网,并且没有防火墙或代理服务器的限制。

    (2)、清除缓存:有时缓存文件可能会导致问题,可以尝试清除缓存并重新执行安装命令。

    (3)、更新pip:确保您使用的是最新版本的pip,可以通过运行"python -m pip install --upgrade pip"来更新pip。

    (4)、安装依赖项:如果错误提示中涉及到了缺少依赖项,那么需要先安装相应的依赖项。

    (5)、降级包版本:如果是由于包版本不兼容引起的错误,可以尝试降级包的版本,以解决兼容性问题。


以上就是云梦编程为大家介绍的关于Preparing metadata (pyproject.toml) did not run successfully解决方法的全部内容了,了解更多相关文章请关注云梦编程网!

© 2023 - 云梦编程网 版权所有 鲁ICP备2021017318号-4