#6073 uv syncResolved 426 packages in 1.84s × Failed to build pynini==2.1.6 ├─▶ The build backend returned an error ╰─▶ Cal

104.28* Posted at: 18 hours ago

uv sync
Resolved 426 packages in 1.84s
× 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
  copying pywrapfst/__init__.py -> build/lib.macosx-11.0-arm64-cpython-310/pywrapfst
  copying pynini/__init__.py -> build/lib.macosx-11.0-arm64-cpython-310/pynini
  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__.py -> build/lib.macosx-11.0-arm64-cpython-310/pynini/examples
  copying pynini/examples/numbers.py -> build/lib.macosx-11.0-arm64-cpython-310/pynini/examples
  copying

......
ed.

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

  !!
    corresp(dist, value, root_dir)
  /Users/tips/.cache/uv/builds-v0/.tmpORjn1R/lib/python3.10/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 :: Apache Software License

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

  !!
    dist._finalize_license_expression()
  /Users/tips/.cache/uv/builds-v0/.tmpORjn1R/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()
  In file included from extensions/_pynini.cpp:1262:
  In file included from extensions/stringmapscript.h:31:
  extensions/stringmap.h:185:26: error: no member named 'StringJoin' in namespace 'fst'; did you mean 'StrJoin'?
    185 |                  

9 Replies

该错误是第三方库 pynini==2.1.6 在 macOS 环境中的编译失败,具体原因是系统安装的 openfst 库版本过高,导致 pynini 找不到已弃用的 StringJoin 方法,而是仅提供 StrJoin

这与 pyVideoTrans 官方推荐的 macOS 部署步骤无直接关联(官方推荐仅安装 libsndfilegit[email protected] 及特定版本的 ffmpeg),但 pynini 作为软件的依赖项被自动引入。

请按以下步骤排查:

  1. 确认执行的是基础安装命令
    仅在源码目录下运行 uv sync不要附加 --all-extras--extra 参数(除非你有明确需要使用 whisper.netwebui),因为 pynini 可能来源于额外依赖。
  2. 卸载系统 openfst
    由于 Homebrew 可能安装了较新版本的 openfst,建议移除它以避免冲突:

    brew uninstall openfst

    然后重新运行 uv sync

  3. 如果仍有问题,提供完整日志
    请到 logs/ 目录下复制最新日志文件的最后30行内容,并在回复中提交。同时请提供软件左上角显示的版本号(例如 v4.05、v4.07 或 v4.5)。
  4. 确认已安装所有 macOS 前置依赖
    根据官方文档,必须执行:

    brew install libsndfile git [email protected]
    brew uninstall --ignore-dependencies ffmpeg
    brew tap homebrew-ffmpeg/ffmpeg
    brew install homebrew-ffmpeg/ffmpeg/ffmpeg

× 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
  copying pywrapfst/__init__.py -> build/lib.macosx-11.0-arm64-cpython-310/pywrapfst
  copying pynini/__init__.py -> build/lib.macosx-11.0-arm64-cpython-310/pynini
  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__.py -> build/lib.macosx-11.0-arm64-cpython-310/pynini/examples
  copying pynini/examples/numbers.py -> build/lib.macosx-11.0-arm64-cpython-310/pynini/examples
  copying pynini/examples/plura

......


  !!
    corresp(dist, value, root_dir)
  /Users/tips/.cache/uv/builds-v0/.tmpbu0ifl/lib/python3.10/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 :: Apache Software License

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

  !!
    dist._finalize_license_expression()
  /Users/tips/.cache/uv/builds-v0/.tmpbu0ifl/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/_pynini.cpp:1235:10: fatal error: 'fst/util.h' file not found
   1235 | #include 
        |          ^~~~~~~~~~~~
  1 error generated.
  error: command '/usr/bin/c++' failed with exit code 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]%

报错核心是 pynini 编译时找不到 openfst 头文件(fst/util.h),需要先安装 openfst 库。

请按以下步骤处理:

  1. 安装 openfst(推荐使用 Homebrew):

    brew install openfst

    如果之前已经卸载过,重新安装即可。注意不要安装 openfst 的过新版本(Homebrew 通常提供稳定版,可接受)。

  2. 确认你执行的安装命令
    请确认你在 pyvideotrans 源码目录下运行的命令是否为最基础的 uv sync(不要加 --all-extras--extra),因为 pynini 并非 pyvideotrans 核心必需依赖,仅在某些额外特性中引入。如果你确实需要这些额外特性,安装 openfst 后重试即可。
  3. 如果仍有问题
    请提供 logs/ 目录下最新日志文件的最后 30 行内容,以及软件左上角显示的版本号(例如 v4.05、v4.07、v4.5)。

怎么查看logs/ 目录下最新日志文件的最后 30 行内容

在 pyVideoTrans 软件安装目录下,找到 logs/ 文件夹。里面是按日期命名的日志文件(如 20250622.log)。请打开最近日期的那个文件,滚动到文件底部,复制最后 30 行内容即可。

如果你在命令行中操作(Mac/Linux),可以运行:

tail -n 30 /path/to/pyvideotrans/logs/$(ls -t /path/to/pyvideotrans/logs/ | head -1)

(将 /path/to/pyvideotrans/ 替换为你的实际软件目录)

或者直接在文件管理器中用任意文本编辑器打开日志文件,拉到页面底部截图或复制最后 30 行。

没有 logs/这个文件夹

你没有看到 logs/ 文件夹是正常的——因为软件尚未成功运行过,日志目录只有在软件启动后才会自动创建。当前问题的根源是 pynini 编译失败,与缺少 openfst 库有关,和日志无关。请直接执行以下步骤解决编译错误:安装 openfst(macOS 使用 Homebrew):brew install openfst如果之前已安装过但版本冲突,可先卸载再重装:brew uninstall --ignore-dependencies openfst && brew install openfst重新运行 uv sync(保持原命令不变,不要加额外参数)。如果仍有问题,请告诉我你执行的精确命令(例如是否是 uv sync 还是 uv sync --all-extras),以及软件版本号(查看 pyvideotrans 目录下 pyproject.toml 中的版本,或源码中 version 字段)。

执行的uv sync,软件版本号是version = "4.05"

该错误是因为缺少 openfst 库导致的,与软件核心功能无关。请按以下步骤解决:

  1. 安装 openfst(macOS 使用 Homebrew):

    brew install openfst
  2. 清理缓存并重新安装(避免使用旧的损坏缓存):

    uv cache clean
    uv sync
  3. 如果仍失败,尝试禁用 pynini 依赖(pynini 并非 pyVideoTrans v4.05 必需,可能是多余依赖导致):

    • 打开 pyproject.toml 文件,搜索 pynini,在其所在行前加 # 注释掉该依赖
    • 再次运行 uv sync
  4. 确认你的安装命令为纯粹的 uv sync,不要带有 --all-extras--extra 参数。

若问题持续,请提供你运行 uv sync 后的完整终端输出(至少最后 30 行),以便进一步分析。

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

Dondate via PayPal

Related resource