【说说】关于windows上pynini和WeTextProcessing的安装


最近尝试vits-chinese的时候,遇到安装pynini和WeTextProcessing依赖报错的问题,报错信息如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
╰─> [65 lines of output]
running bdist_wheel
running build
...
cl: 命令行 error D8021 :无效的数值参数“/Wno-register”
error: command 'A:\\VS\\VC\\Tools\\MSVC\\14.43.34808\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[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: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pynini)

1.pynini

pynini 是一个依赖 C++ 扩展的库,在 Windows 环境下需要特定的编译工具链和配置才能成功编译。

根据 pynini 官方文档的建议,使用 Windows Subsystem for Linux (WSL) 是解决在 Windows 上安装和运行 pynini 的推荐方法。但是已经在windows上操作了几步了,实在是不想换。

于是既然使用pip install方式,安装报错,那么就可以考虑使用conda install方式安装,如下所示:

1
conda install -c conda-forge pynini

但是在成功下载后,继续下载WeTextProcessing,依旧包同样的错。

1
pip install WeTextProcessing

2.WeTextProcessing

看一下

1
2
3
4
5
6
7
8
(vits_chinese) PS D:\000myself\000文档\bishe\vits_chinese> pip install WeTextProcessing
Collecting WeTextProcessing
Using cached WeTextProcessing-1.0.4.1-py3-none-any.whl.metadata (7.2 kB)
Collecting pynini==2.1.6 (from WeTextProcessing)
Using cached pynini-2.1.6.tar.gz (789 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done

直接下载时候,会尝试下载pynini-2.1.6,而根据之前的内容,我们 conda install -c conda-forge pynini 的操作后下载的是 2.1.6.post1

虽然按理说这应该没问题,但是严谨考虑可能是版本问题,既然2.1.6不行,那么2.1.5呢?

3.成功

所以,就考虑了

1
2
conda install -c conda-forge pynini=2.1.5
pip install WeTextProcessing==1.0.2

于是,成功咯

1
2
3
4
5
6
7
Downloading WeTextProcessing-1.0.2-py3-none-any.whl (2.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 7.7 MB/s eta 0:00:00
Using cached importlib_resources-6.4.5-py3-none-any.whl (36 kB)
Using cached Cython-3.0.12-cp38-cp38-win_amd64.whl (2.8 MB)
Using cached zipp-3.20.2-py3-none-any.whl (9.2 kB)
Installing collected packages: zipp, Cython, importlib-resources, WeTextProcessing
Successfully installed Cython-3.0.12 WeTextProcessing-1.0.2 importlib-resources-6.4.5 zipp-3.20.2

4.后话

本来感觉这个不想写的,但这玩意儿实在是折磨了我太久。

先是试着用WSL,但是折腾到一半,搞乱了,后来在csdn上看到的几个办法全是无用功。。。。

真的是,算我傻吧。。


文章作者: ZTGD
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 ZTGD !
评论
  目录