python=3.12环境在编译 pynini 时无法找到它依赖的 openfst 头文件
clang++ -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -I/Users/v_yemianjun/.pyenv/versions/3.12.3/include/python3.12 -c extensions/_pywrapfst.cpp -o build/temp.macosx-14.4-arm64-cpython-312/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 extensions/_pywrapfst.cpp:1190:10: fatal error: 'fst/util.h' file not found #include <fst/util.h> ^~~~~~~~~~~~ 1 error 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 Failed to build pynini ERROR: Could not build wheels for pynini, which is required to install pyproject.toml-based projects
您好, 可以尝试手动安装 pynini 和 WeTextProcessing
conda install -c conda-forge pynini=2.1.6.post1 -y
pip install git+https://github.com/WhizZest/WeTextProcessing.git
pip install -r requirements.txt
If you are using Windows without Conda, you can download the package from the link and install it. However, after installation, you need to modify the version number of the pynini package in your virtual environment (for example, in my case: .venv\Lib\site-packages\pynini_init_.py): change __version__ = "2.1.6.post1" to __version__ = "2.1.6". Then, install both pynini and WeTextProcessing, and it should work.