Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pynini building failed #39

Open
matrixloong opened this issue Dec 9, 2024 · 2 comments
Open

pynini building failed #39

matrixloong opened this issue Dec 9, 2024 · 2 comments

Comments

@matrixloong
Copy link

D:\Program_Files\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IE:.py_users\cosyvoice\include -ID:\pythonwares\include -ID:\pythonwares\Include -ID:\Program_Files\VC\Tools\MSVC\14.33.31629\include -ID:\Program_Files\VC\Auxiliary\VS\include "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpextensions/_pywrapfst.cpp /Fobuild\temp.win-amd64-cpython-311\Release\extensions/_pywrapfst.obj -std=c++17 -Wno-register -Wno-deprecated-declarations -Wno-unused-function -Wno-unused-local-typedefs -funsigned-char
cl: 命令行 error D8021 :无效的数值参数“/Wno-register”
error: command 'D:\Program_Files\VC\Tools\MSVC\14.33.31629\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
Running setup.py clean for pynini
Building wheel for openai-whisper (pyproject.toml) ... done
Created wheel for openai-whisper: filename=openai_whisper-20240930-py3-none-any.whl size=803358 sha256=c94d32a80873b34db9e6bf3fba0dd1ab3b9b3a38a4a8b2fda46e0b4c700b2a50
Stored in directory: C:\Users\uchel\AppData\Local\Temp\pip-ephem-wheel-cache-qunpoutc\wheels\c0\4c\99\411c41ae3624e7195da55c9eeb7e30f86f96937e861dbce24f
Building wheel for oss2 (setup.py) ... done
Created wheel for oss2: filename=oss2-2.19.1-py3-none-any.whl size=123995 sha256=dd58ee53b6fe20c57ee2abc303061fb1c900ec2233f36e0629c58429b7e8cc51
Stored in directory: C:\Users\uchel\AppData\Local\Temp\pip-ephem-wheel-cache-qunpoutc\wheels\9d\07\fe\0557f075827e868a01ead8e267775834d96066f640fc22f4e4
Building wheel for aliyun-python-sdk-core (setup.py) ... done
Created wheel for aliyun-python-sdk-core: filename=aliyun_python_sdk_core-2.16.0-py3-none-any.whl size=535335 sha256=8937ec63de2413a73499ec250207de57eaab536fd04f3b1691e641632574c552
Stored in directory: C:\Users\uchel\AppData\Local\Temp\pip-ephem-wheel-cache-qunpoutc\wheels\33\6e\84\3ab330a80db9fd9aced6374b9ac6fb07b568ff5e34a0459467
Building wheel for crcmod (setup.py) ... done
Created wheel for crcmod: filename=crcmod-1.7-cp311-cp311-win_amd64.whl size=25178 sha256=a276e4ca0b41d86976f5568a45fcda092ea5109a34500174459a1702ffd7580f
Stored in directory: C:\Users\uchel\AppData\Local\Temp\pip-ephem-wheel-cache-qunpoutc\wheels\98\0e\47\7155763f88847c6154be847b242d776a397905933155c7a7d9
Successfully built wget antlr4-python3-runtime openai-whisper oss2 aliyun-python-sdk-core crcmod
Failed to build pynini
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pynini)

@matrixloong
Copy link
Author

https://github.com/kylebgorman/pynini

Windows
While Pynini is neither designed for nor tested on Windows, it can be installed using the Windows Subsystem for Linux (WSL). Simply enter the WSL environment and follow the Linux instructions below.

solution? have any better?

@DeadBranches
Copy link

DeadBranches commented Jan 3, 2025

Hi @matrixloong. Here's how I resolved the issue.

Issues and solutions

issue
Pynini is hard to compile on windows.
solution
Conda includes a precompiled binary of pinini. Install cosyvoice for windows using miniconda by installing pynini from the conda package manager.


issue
One of cosyvoice's dependencies tries to build pynini when installing CosyVoice requirements via the command python -m pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com
solution
Pin the version of pynini that the dependency needs (2.1.5) in the CosyVoice requirements.txt to prevent pip from trying to build a different version. Install the same version of pynini with the conda package manger.

Process

  1. Create the conda environment:
    conda create -n cosyvoice python=3.11 pytorch=2.0.1 torchaudio=2.0.2 torchvision pytorch-cuda=12.1 cudnn=9.3 -c pytorch -c nvidia pynini=2.1.5 -c forge cython -c anaconda -y
    Note: You also need cython, so might as well install it now.
    Note: Above, I'm installing the versions of pytorch and torchaudio as pinned in the repo requirements.txt (effective Jan 1st, 2025)
    Note: Although at the top of the repo README.md it states to use version 12.6 of cuda for the fastest speeds, the readme also states to use cuda 12.1. So, I'm using 12.1.
    Note: The conda package manager didn't have cudnn 9.4, so I'm installing 9.3 (effective Jan 1, 2025)
  2. Clone the CosyVoice repo and activate the cosyvoice environment.
  3. Edit the CosyVoice requirements.txt and pin pynini version 2.1.5

in bash

cd CosyVoice_For_Windows
echo "pynini==2.1.5" >> requirements.txt

in nushell

cd CosyVoice_For_Windows
open requirements.txt | str append "\npynini==2.1.5" | save --force requirements.txt
  1. Continue the install from the repo README.md file by installing the package dependencies from requirements.txt
    python -m pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants