#5046 junyouchen@JunyouChendeMacBook-Air pyvideotrans % uv sync --all-extrasResolved 371 packages in 1.49s Built sox==1.5.0×

50.7* Posted at: 2 hours ago

junyouchen@JunyouChendeMacBook-Air pyvideotrans % uv sync --all-extras
Resolved 371 packages in 1.49s

  Built sox==1.5.0

× 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

......
0-arm64-cpython-310/pynini/lib

  copying pynini/export/BUILD.bazel -> build/lib.macosx-11.0-arm64-cpython-310/pynini/export
  copying pynini/export/grm_py_build_defs.bzl -> build/lib.macosx-11.0-arm64-cpython-310/pynini/export
  copying pynini/export/py.typed -> build/lib.macosx-11.0-arm64-cpython-310/pynini/export
  running build_ext
  building '_pywrapfst' extension
  creating build/temp.macosx-11.0-arm64-cpython-310/extensions
  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/junyouchen/.cache/uv/builds-v0/.tmpN3f504/include
  -I/Users/junyouchen/.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

  [stderr]
  /Users/junyouchen/.cache/uv/builds-v0/.tmpN3f504/lib/python3.10/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 2027-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)
  /Users/junyouchen/.cache/uv/builds-v0/.tmpN3f504/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/junyouchen/.cache/uv/builds-v0/.tmpN3f504/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:1190:10: fatal error: 'fst/util.h' file not found
   1190 | #include 
        |          ^~~~~~~~~~~~
  1 error generated.
  error: command '/usr/bin/c++' failed with exit code 1

  hint: This error likely indicates that you need to install a library that provides "fst/util.h" for `[email protected]`

help: pynini (v2.1.6) was included because pyvideotrans[mosstts] (v4.0) depends on pynini

1 Replies

该错误是由于编译 pynini 时缺少 OpenFst 库的头文件 fst/util.h 所致。pynini 是 OpenFst 的 Python 包装器,需要系统中预先安装 OpenFst 开发库。

解决方案:使用 Homebrew 安装 OpenFst,然后重新执行依赖同步。

brew install openfst
uv sync --all-extras

如果仍然报错,请确认 Homebrew 安装的 OpenFst 路径已被编译器找到。通常 Homebrew 会自动处理。


如果你不需要 MOSS-TTS 功能,也可以跳过 --all-extras,仅安装必要依赖:

uv sync

这样可以避免编译 pynini,但会缺失 MOSS-TTS 和 Qwen-ASR 等本地渠道。

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: ko-fi.com/jianchang512

Related resource