幽灵的祖先 2025-06-02 00:32 采纳率: 0%
浏览 271

pyopenjtalk构建报错


Building wheel for pyopenjtalk (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyopenjtalk (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [74 lines of output]
      D:\usertemp\pip-build-env-iikskfi1\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated
      !!

              ********************************************************************************
              Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0).

              By 2026-Feb-18, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************

      !!
        corresp(dist, value, root_dir)
      D:\usertemp\pip-build-env-iikskfi1\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!

              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:

              License :: OSI Approved :: MIT License

              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************

      !!
        dist._finalize_license_expression()
      D:\usertemp\pip-build-env-iikskfi1\overlay\Lib\site-packages\setuptools\dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!

              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:

              License :: OSI Approved :: MIT License

              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************

      !!
        self._finalize_license_expression()
      CMake is in the system path. Version:               cmake version 4.0.2

      CMake suite maintained and supported by Kitware (kitware.com/cmake).
      running bdist_wheel
      running build
      running build_py
      creating build\lib.win-amd64-cpython-311\pyopenjtalk
      copying pyopenjtalk\utils.py -> build\lib.win-amd64-cpython-311\pyopenjtalk
      copying pyopenjtalk\version.py -> build\lib.win-amd64-cpython-311\pyopenjtalk
      copying pyopenjtalk\__init__.py -> build\lib.win-amd64-cpython-311\pyopenjtalk
      running egg_info
      writing pyopenjtalk.egg-info\PKG-INFO
      writing dependency_links to pyopenjtalk.egg-info\dependency_links.txt
      writing requirements to pyopenjtalk.egg-info\requires.txt
      writing top-level names to pyopenjtalk.egg-info\top_level.txt
      reading manifest file 'pyopenjtalk.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files found matching '.gitignore'
      warning: no previously-included files found matching '.gitmodules'
      warning: no previously-included files found matching '.travis.yml'
      warning: no previously-included files found matching 'tox.ini'
      no previously-included directories found matching '.github\*'
      no previously-included directories found matching 'docs\**'
      adding license file 'LICENSE.md'
      writing manifest file 'pyopenjtalk.egg-info\SOURCES.txt'
      creating build\lib.win-amd64-cpython-311\pyopenjtalk\htsvoice
      copying pyopenjtalk\htsvoice\LICENSE_mei_normal.htsvoice -> build\lib.win-amd64-cpython-311\pyopenjtalk\htsvoice
      copying pyopenjtalk\htsvoice\README.md -> build\lib.win-amd64-cpython-311\pyopenjtalk\htsvoice
      copying pyopenjtalk\htsvoice\mei_normal.htsvoice -> build\lib.win-amd64-cpython-311\pyopenjtalk\htsvoice
      running build_ext
      Compiling pyopenjtalk\openjtalk.pyx because it changed.
      [1/1] Cythonizing pyopenjtalk\openjtalk.pyx
      building 'pyopenjtalk.openjtalk' extension
      error: Unable to find a compatible Visual Studio installation.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyopenjtalk
Failed to build pyopenjtalk
ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyopenjtalk)

在已经确保VS的环境配置没有问题以及环境变量配置没有问题的情况下仍然报这个错误,该如何解决

  • 写回答

6条回答 默认 最新

  • 码农阿豪@新空间 优质创作者: Java、后端开发技术领域 2025-06-02 05:34
    关注
    让阿豪来帮你解答,本回答参考chatgpt3.5编写提供,如果还有疑问可以评论或留言
    根据上面的错误日志,问题出在构建`pyopenjtalk`包的wheel时发生了错误。错误是由于`project.license`在`pyproject.toml`文件中以TOML表格的形式传递,而此行为已被弃用。解决方案是更改`project.license`为一个包含SPDX表达式的简单字符串。下面是具体的解决步骤:
    1. 打开pyproject.toml文件,找到project.license这一行。
    2. 将其从TOML表格形式更改为一个包含SPDX表达式的简单字符串。例如,将其从类似于以下的形式:
      [project]
      license = { name = "MIT" }
      

      更改为简单的字符串形式:

      [project]
      license = "MIT"
      
    3. 保存并关闭pyproject.toml文件。
    4. 重新运行构建pyopenjtalk包的命令。 示例代码:
    [project]
    name = "myproject"
    version = "1.0.0"
    description = "My project description"
    license = "MIT"
    

    这样做后,应该能够成功构建pyopenjtalk包的wheel文件。

    评论

报告相同问题?

问题事件

  • 创建了问题 6月2日