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-l81poy77\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-l81poy77\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-l81poy77\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)
时间: 2025-06-02 14:59:38 浏览: 14
<think>嗯,用户现在遇到了pyopenjtalk构建失败的问题,尤其是和Visual Studio安装兼容性相关的错误。我需要仔细分析他的情况,并参考之前的引用内容来给出解决方案。首先,用户提到错误信息是“subprocess-exited-with-error”以及cmake的问题。根据引用[2],之前有类似的问题是通过修改cmake命令的参数解决的。例如,添加特定的参数来绕过某些依赖项,比如将HTS_ENGINE_LIB设置为dummy。这可能是一个关键点,需要建议用户检查他们的构建脚本或安装步骤,是否应用了正确的cmake参数。
接下来,用户提到VisualStudio的兼容性问题。引用[4]中提到了安装Visual StudioBuild Tools的必要性,特别是C++桌面开发组件和CMake工具。这可能意味着用户没有正确安装这些构建工具,或者版本不兼容。需要详细指导用户安装正确的组件,并确保环境变量配置正确。另外,引用[3]中提到安装dlib时遇到的问题,其中提到了安装CMake和正确配置环境变量的重要性。虽然问题不同,但同样涉及CMake的使用,这可能提示用户需要检查CMake的安装情况,确保其版本与pyopenjtalk兼容,并且已添加到系统路径中。用户可能已经尝试过一些方法,比如安装CMake或者调整参数,但可能没有正确应用所有必要的步骤。需要分步骤引导用户,确认每一步都正确执行,比如安装Visual StudioBuild Tools的特定组件,修改cmake命令的参数,以及设置环境变量。此外,用户可能在Windows环境下使用Python,需要特别注意Windows的构建工具链。比如,可能需要使用特定版本的VisualStudio工具,或者管理员权限运行命令。还要考虑Python版本是否与构建工具兼容,以及是否需要使用虚拟环境。最后,需要提醒用户在安装过程中可能遇到的常见陷阱,例如权限问题、路径配置错误,或者依赖项缺失。建议用户按照步骤逐一排查,并在必要时提供详细的命令示例,如修改后的cmake命令,或者安装组件的具体步骤。</think>根据你的需求和错误描述,该问题通常与CMake配置、Visual Studio构建工具链缺失或版本不兼容有关。以下是分步解决方案:
### 一、核心问题定位
1. **关键报错线索**:`subprocess-exited-with-error`提示CMake构建过程失败
2. **兼容性根源**:Windows系统缺少C++编译环境或CMake工具链配置不当[^2][^4]
### 二、分步解决方案
#### ▶ 步骤1:安装完整构建工具链
1. **安装Visual Studio Build Tools**
- 下载地址:[Build Tools for Visual Studio](https://visualstudio.microsoft.com/zh-hans/downloads/)
- 勾选以下组件:
```markdown
√ 使用C++的桌面开发
√ MSVC v143 VS 2022 C++ x64/x86生成工具
√ Windows 10 SDK
√ C++ CMake工具(必须!)
```
- 验证安装:命令行执行`cmake --version`[^4]
#### ▶ 步骤2:修复CMake参数(关键)
1. **修改pyopenjtalk构建脚本**
```python
# 将原cmake命令修改为:
r = subprocess.run([
"cmake", "..",
"-DHTS_ENGINE_INCLUDE_DIR=.",
"-DHTS_ENGINE_LIB=dummy", # 绕过HTS引擎依赖
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
"-G", "Visual Studio 17 2022" # 指定生成器版本
])
```
*注意:此参数修改可跳过缺失的HTS引擎检查[^2]*
#### ▶ 步骤3:环境变量配置
1. **添加路径到系统变量**
```shell
# 示例路径(需根据实际安装位置调整)
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64
C:\Program Files\CMake\bin
```
### 三、验证流程
1. **管理员模式运行命令提示符**
```shell
pip install pyopenjtalk --no-cache-dir --force-reinstall
```
2. **若仍失败,尝试指定生成器**:
```shell
cmake -G "Visual Studio 17 2022" ..
```
### 四、常见陷阱规避
1. **Python环境要求**:
- 使用Python 3.8+且≤3.11(最新版本可能兼容性差)
- 推荐使用`conda`虚拟环境
2. **权限问题**:
- 所有操作需在管理员权限下执行
3. **残留文件清理**:
```shell
pip uninstall pyopenjtalk
rm -rf build/ dist/ # 删除旧构建文件
```
阅读全文
相关推荐
















