note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pynini Failed to build pynini ERROR: Could not build wheels for pynini, which is required to install pyproject.toml-based projects
核心是'fst/util.h' file not found,应该不存在 openfst,那么安装brew install openfst,然后再次pip install -r requirements.txt,依旧失败:
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pynini Failed to build pynini error: failed-wheel-build-for-install
× Failed to build installable wheels for some pyproject.toml based projects ╰─> pynini
... building '_pynini' extension clang++ -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -DOPENSSL_NO_SSL3 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -Iextensions -I/Users/Harry/Workspace/ModelScope/IndexTTS-2-Demo/.venv/include -I/Users/Harry/.pyenv/versions/3.9.23/include/python3.9 -c extensions/_pynini.cpp -o build/temp.macosx-15.7-arm64-cpython-39/extensions/_pynini.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 In file included from extensions/_pynini.cpp:1252: 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 | << fst::StringJoin(line, "\t") << "`"; | ~~~~~^~~~~~~~~~ | StrJoin /opt/homebrew/opt/openfst/include/fst/compat.h:197:13: note: 'StrJoin' declared here 197 | std::string StrJoin(const std::vector<S> &elements, std::string_view delim) { | ^ In file included from extensions/_pynini.cpp:1252: In file included from extensions/stringmapscript.h:31: extensions/stringmap.h:230:26: error: no member named 'StringJoin' in namespace 'fst'; did you mean 'StrJoin'? 230 | << fst::StringJoin(line, "\t") << "`"; | ~~~~~^~~~~~~~~~ | StrJoin /opt/homebrew/opt/openfst/include/fst/compat.h:197:13: note: 'StrJoin' declared here 197 | std::string StrJoin(const std::vector<S> &elements, std::string_view delim) { | ^ 2 errors generated. error: command '/usr/bin/clang++' failed with exit code 1 [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pynini Building wheel for distance (pyproject.toml) ... done Created wheel for distance: filename=distance-0.1.3-py3-none-any.whl size=16321 sha256=5b3994bb5686de9bbc7f78ce4f2e702b482f572e8620f0e8216d827950dabdae Stored in directory: /Users/Harry/Library/Caches/pip/wheels/fb/b3/aa/04241cced6d1722b132273b1d6aafba317887ec004f48b853a Building wheel for argbind (pyproject.toml) ... done Created wheel for argbind: filename=argbind-0.3.9-py2.py3-none-any.whl size=11816 sha256=d19bcc9a580acc68e2b638466adefc2ef26058064a3e8cab62acda610b7a539d Stored in directory: /Users/Harry/Library/Caches/pip/wheels/3e/9e/9c/0ab23ae19848099a030aaa8f68a3875e629671d859a40a7fc9 Building wheel for julius (pyproject.toml) ... done Created wheel for julius: filename=julius-0.2.7-py3-none-any.whl size=21966 sha256=fb8693a91aed2dd06389c064ff742fdb7f6d3d722ef79f5ad2f4707e10d178ab Stored in directory: /Users/Harry/Library/Caches/pip/wheels/53/0a/a7/fc08f97438f4969d86afa7904336c2eb7eb422101359f3ad11 Building wheel for randomname (pyproject.toml) ... done Created wheel for randomname: filename=randomname-0.2.1-py3-none-any.whl size=89288 sha256=472a9c1becbf4931603c4affad5c5748b46dca930643b795721cc0ecf8265bae Stored in directory: /Users/Harry/Library/Caches/pip/wheels/32/f7/3b/a46d1bb5fd36d11db2d6c267513fb405f2457cbcd6b50c760f Successfully built jieba deepspeed antlr4-python3-runtime distance argbind julius randomname Failed to build pynini error: failed-wheel-build-for-install
× Failed to build installable wheels for some pyproject.toml based projects ╰─> pynini
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 | << fst::StringJoin(line, "\t") << "`"; | ~~~~~^~~~~~~~~~ | StrJoin
看信息是安装 pynini extion 时失败了,从error: no member named 'StringJoin' in namespace 'fst'; did you mean 'StrJoin'?看还是 pynini 和 openfst 不兼容的问题。在 OpenFST 1.8.0 中,StringJoin函数被重命名为StrJoin了,所以我们得修改 pynini 源码来安装了:
... Using cached wcwidth-0.2.14-py2.py3-none-any.whl (37 kB) Building wheels for collected packages: pynini Building wheel for pynini (pyproject.toml) ... error error: subprocess-exited-with-error
× Building wheel for pynini (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [68 lines of output] /private/var/folders/wh/33kqcmn975z7bsfmvmlrsy880000gp/T/pip-build-env-o0w8wif1/overlay/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 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. ********************************************************************************
******************************************************************************** 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() /private/var/folders/wh/33kqcmn975z7bsfmvmlrsy880000gp/T/pip-build-env-o0w8wif1/overlay/lib/python3.10/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 :: Apache Software License
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ********************************************************************************
!! self._finalize_license_expression() running bdist_wheel running build running build_py running egg_info writing pynini.egg-info/PKG-INFO writing dependency_links to pynini.egg-info/dependency_links.txt writing top-level names to pynini.egg-info/top_level.txt reading manifest file 'pynini.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' adding license file 'AUTHORS' writing manifest file 'pynini.egg-info/SOURCES.txt' running build_ext building '_pywrapfst' extension clang++ -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/opt/homebrew/opt/openfst/include -I/Users/Harry/Workspace/ModelScope/IndexTTS-2-Demo/.venv/include -I/Users/Harry/.pyenv/versions/3.10.12/include/python3.10 -c extensions/_pywrapfst.cpp -o build/temp.macosx-15.7-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 In file included from extensions/_pywrapfst.cpp:1193: In file included from /opt/homebrew/opt/openfst/include/fst/fstlib.h:57: /opt/homebrew/opt/openfst/include/fst/const-fst.h:403:25: warning: comparison of integers of different signs: 'int64_t' (aka 'long long') and 'size_t' (aka 'unsigned long') [-Wsign-compare] 403 | if (hdr.NumStates() != num_states) { | ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~ /opt/homebrew/opt/openfst/include/fst/const-fst.h:407:23: warning: comparison of integers of different signs: 'int64_t' (aka 'long long') and 'size_t' (aka 'unsigned long') [-Wsign-compare] 407 | if (hdr.NumArcs() != num_arcs) { | ~~~~~~~~~~~~~ ^ ~~~~~~~~ 2 warnings generated. clang++ -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/opt/homebrew/opt/openfst/include -bundle -undefined dynamic_lookup -I/opt/homebrew/opt/openfst/include build/temp.macosx-15.7-arm64-cpython-310/extensions/_pywrapfst.o -L/Users/Harry/.pyenv/versions/3.10.12/lib -lfstfarscript -lfstfar -lfstscript -lfst -lm -ldl -o build/lib.macosx-15.7-arm64-cpython-310/_pywrapfst.cpython-310-darwin.so ld: library 'fstfarscript' not found clang++: error: linker command failed with exit code 1 (use -v to see invocation) error: command '/usr/bin/clang++' failed with exit code 1 [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pynini Failed to build pynini error: failed-wheel-build-for-install
× Failed to build installable wheels for some pyproject.toml based projects ╰─> pynini
好家伙,还是链接错误ld: library 'fstfarscript' not found,这是由于 OpenFST 的库命名在不同 Python 版本下行为不一致导致的,查了一下可能的原因:
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/, https://pypi.tuna.tsinghua.edu.cn/simple/, https://mirrors.ustc.edu.cn/pypi/simple/, https://pypi.org/simple/ Collecting protobuf==3.20.3 ... modelscope - INFO - Got n files, start to download ... ... modelscope - INFO - Download model 'IndexTeam/IndexTTS-2' successfully. ---model_id--- nvidia/bigvgan_v2_22khz_80band_256x Loading weights from nv-community/bigvgan_v2_22khz_80band_256x Removing weight norm... >> bigvgan weights restored from: nvidia/bigvgan_v2_22khz_80band_256x >> TextNormalizer loaded >> bpe model loaded from: ./checkpoints/bpe.model * Running on local URL: http://192.168.1.3:7860 * To create a public link, set `share=True` in `launch()`.