#6612 × Failed to build pynini==2.1.6 ├─▶ The build backend returned an error ╰─▶ Call to setuptools.build_meta:__legacy__.b

82.152.**9 Posted at: 1 day ago

× Failed to build pynini==2.1.6
├─▶ The build backend returned an error
╰─▶ Call to setuptools.build_meta:__legacy__.build_wheel failed (exit status: 1)

  [stdout]
  running bdist_wheel
  running build
  running build_py
  creating build/lib.macosx-11.0-arm64-cpython-310/pywrapfst
  copying pywrapfst/__init__.py -> build/lib.macosx-11.0-arm64-cpython-310/pywrapfst
  creating build/lib.macosx-11.0-arm64-cpython-310/pynini
  copying pynini/__init__.py -> build/lib.macosx-11.0-arm64-cpython-310/pynini
  creating build/lib.macosx-11.0-arm64-cpython-310/pynini/examples
  copying pynini/examples/chatspeak.py ->
  build/lib.macosx-11.0-arm64-cpython-310/pynini/examples
  copying pynini/examples/chatspeak_model.py ->
  build/lib.macosx-11.0-arm64-cpython-310/pynini/examples
  copying pynini/examples/weather.py ->
  build/lib.macosx-11.0-arm64-cpython-310/pynini/examples
  copying pynini/examples/__init_

......

  !!
    dist._finalize_license_expression()
  /Users/po./.cache/uv/builds-v0/.tmpSWqUc2/lib/python3.10/site-packages/setuptools/dist.py:765:
  SetuptoolsDeprecationWarning: License classifiers are deprecated.
  !!

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

          License :: OSI Approved :: Apache Software License

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

  !!
    self._finalize_license_expression()
  extensions/_pywrapfst.cpp:1201:10: fatal error: 'fst/util.h' file not found
   1201 | #include 
        |          ^~~~~~~~~~~~
  1 error generated.
  error: Command '['c++', '-Wno-unused-result', '-Wsign-compare',
  '-Wunreachable-code', '-DNDEBUG', '-g', '-fwrapv', '-O3',
  '-Wall', '-O3', '-arch', 'arm64', '-mmacosx-version-min=11.0',
  '-Wno-nullability-completeness', '-Wno-expansion-to-defined', '-Wno-undef-prefix',
  '-fPIC', '-I/Users/po./.cache/uv/builds-v0/.tmpSWqUc2/include',
  '-I/Users/po./.local/share/uv/python/cpython-3.10.19-macos-aarch64-none/include/python3.10',
  '-c', 'extensions/_pywrapfst.cpp', '-o',
  'build/temp.macosx-11.0-arm64-cpython-310/extensions/_pywrapfst.o', '-std=c++17',
  '-Wno-register', '-Wno-deprecated-declarations', '-Wno-unused-function',
  '-Wno-unused-local-typedefs', '-funsigned-char', '-stdlib=libc++',
  '-mmacosx-version-min=10.12']' returned non-zero exit status 1.

hint: pynini (v2.1.6) was included because pyvideotrans (v4.5) depends on pynini
hint: This error likely indicates that you need to install a library that provides "fst/util.h" for [email protected]

1 Replies

#1 DeepSeek reply at 1 day ago

该报错是 pynini==2.1.6 编译安装失败,核心原因是缺少 OpenFst 头文件 fst/util.h。这属于源码部署时上游 Python 依赖编译失败,不是 pyVideoTrans 主程序运行阶段报错。

处理建议:

  1. 先按官方 macOS 部署要求补齐基础依赖:

    brew install libsndfile
    brew install git
    brew install [email protected]
    brew uninstall --ignore-dependencies ffmpeg
    brew tap homebrew-ffmpeg/ffmpeg
    brew install homebrew-ffmpeg/ffmpeg/ffmpeg
  2. 安装 OpenFst,为 pynini 提供 fst/util.h

    brew install openfst

    brew install openfst 不可用或安装后仍找不到头文件,需要手动编译安装 OpenFst,并将头文件/库路径加入环境变量:

    export CPLUS_INCLUDE_PATH=/path/to/openfst/include:$CPLUS_INCLUDE_PATH
    export LIBRARY_PATH=/path/to/openfst/lib:$LIBRARY_PATH
  3. 重新执行依赖安装:

    uv sync --index https://mirrors.aliyun.com/pypi/simple/
  4. 如果上述方法仍无法解决,请提供 logs/ 目录下最新日志(复制底部约 30 行报错信息),以便进一步分析。

另外,你当前日志显示安装的是 pyvideotrans v4.5,与官方记录的最新版本 v4.09 不一致,请确认是否从官方 GitHub 仓库拉取了最新源码。

请查阅相关文档:

Thinking...
Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource