facebookresearch / fairseq

Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
MIT License
30.63k stars 6.42k forks source link

installing fairseq #5196

Open 24bit192kHz opened 1 year ago

24bit192kHz commented 1 year ago

i tried installing it using coua, pip and the by editable nothing worked i also pleased it on PATH and installed c++ stuff

MSVC v143 - VS 2022 C++ x64/x86 build Windows 11 SDK (10.0.22000.0) C++ CMake tools for Windows Testing tools core features - Build Tools C++ AddressSanitizer Windows 11 SDK (10.0.22621.0) Windows 10 SDK (10.0.20348.0) MSVC v142 - VS 2019 C++ x64/x86 build

this is what happen when i try to install it

`C:\Windows\system32>pip install fairseq Collecting fairseq Using cached fairseq-0.12.2.tar.gz (9.6 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: cffi in c:\python310\lib\site-packages (from fairseq) (1.15.1) Collecting cython (from fairseq) Using cached Cython-0.29.35-py2.py3-none-any.whl (988 kB) Collecting hydra-core<1.1,>=1.0.7 (from fairseq) Using cached hydra_core-1.0.7-py3-none-any.whl (123 kB) Collecting omegaconf<2.1 (from fairseq) Using cached omegaconf-2.0.6-py3-none-any.whl (36 kB) Collecting regex (from fairseq) Using cached regex-2023.6.3-cp310-cp310-win_amd64.whl (268 kB) Collecting sacrebleu>=1.4.12 (from fairseq) Using cached sacrebleu-2.3.1-py3-none-any.whl (118 kB) Requirement already satisfied: torch in c:\python310\lib\site-packages (from fairseq) (2.0.1+cu118) Requirement already satisfied: tqdm in c:\python310\lib\site-packages (from fairseq) (4.65.0) Collecting bitarray (from fairseq) Using cached bitarray-2.7.4-cp310-cp310-win_amd64.whl (118 kB) Requirement already satisfied: torchaudio>=0.8.0 in c:\python310\lib\site-packages (from fairseq) (2.0.2+cu118) Requirement already satisfied: numpy in c:\python310\lib\site-packages (from fairseq) (1.24.1) Collecting antlr4-python3-runtime==4.8 (from hydra-core<1.1,>=1.0.7->fairseq) Using cached antlr4_python3_runtime-4.8-py3-none-any.whl Collecting PyYAML>=5.1.* (from omegaconf<2.1->fairseq) Using cached PyYAML-6.0-cp310-cp310-win_amd64.whl (151 kB) Requirement already satisfied: typing-extensions in c:\python310\lib\site-packages (from omegaconf<2.1->fairseq) (4.4.0) Collecting portalocker (from sacrebleu>=1.4.12->fairseq) Using cached portalocker-2.7.0-py2.py3-none-any.whl (15 kB) Collecting tabulate>=0.8.9 (from sacrebleu>=1.4.12->fairseq) Using cached tabulate-0.9.0-py3-none-any.whl (35 kB) Requirement already satisfied: colorama in c:\python310\lib\site-packages (from sacrebleu>=1.4.12->fairseq) (0.4.6) Collecting lxml (from sacrebleu>=1.4.12->fairseq) Using cached lxml-4.9.2-cp310-cp310-win_amd64.whl (3.8 MB) Requirement already satisfied: filelock in c:\python310\lib\site-packages (from torch->fairseq) (3.9.0) Requirement already satisfied: sympy in c:\python310\lib\site-packages (from torch->fairseq) (1.11.1) Requirement already satisfied: networkx in c:\python310\lib\site-packages (from torch->fairseq) (3.0) Requirement already satisfied: jinja2 in c:\python310\lib\site-packages (from torch->fairseq) (3.1.2) Requirement already satisfied: pycparser in c:\python310\lib\site-packages (from cffi->fairseq) (2.21) Requirement already satisfied: MarkupSafe>=2.0 in c:\python310\lib\site-packages (from jinja2->torch->fairseq) (2.1.2) Collecting pywin32>=226 (from portalocker->sacrebleu>=1.4.12->fairseq) Using cached pywin32-306-cp310-cp310-win_amd64.whl (9.2 MB) Requirement already satisfied: mpmath>=0.19 in c:\python310\lib\site-packages (from sympy->torch->fairseq) (1.2.1) Building wheels for collected packages: fairseq Building wheel for fairseq (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for fairseq (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [1440 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-310 creating build\lib.win-amd64-cpython-310\fairseq copying fairseq\binarizer.py -> build\lib.win-amd64-cpython-310\fairseq copying fairseq\checkpoint_utils.py -> build\lib.win-amd64-cpython-310\fairseq copying fairseq\file_chunker_utils.py -> build\lib.win-amd64-cpython-310\fairseq copying fairseq\file_io.py -> build\lib.win-amd64-cpython-310\fairseq copying fairseq\file_utils.py -> build\lib.win-amd64-cpython-310\fairseq copying fairseq\hub_utils.py -> build\lib.win-amd64-cpython-310\fairseq copying fairseq\incremental_decodingutils.py -> build\lib.win-amd64-cpython-310\fairseq (coppying stuff etc...) copying fairseq\config\model\wav2vec2\wav2vec2_large.yaml -> build\lib.win-amd64-cpython-310\fairseq\config\model\wav2vec2 running build_ext cythoning fairseq/data/data_utils_fast.pyx to fairseq/data\data_utils_fast.cpp cythoning fairseq/data/token_block_utils_fast.pyx to fairseq/data\token_block_utils_fast.cpp building 'fairseq.libbleu' extension creating build\temp.win-amd64-cpython-310 creating build\temp.win-amd64-cpython-310\Release creating build\temp.win-amd64-cpython-310\Release\fairseq creating build\temp.win-amd64-cpython-310\Release\fairseq\clib creating build\temp.win-amd64-cpython-310\Release\fairseq\clib\libbleu "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Python310\include -IC:\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\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" /EHsc /Tpfairseq/clib/libbleu/libbleu.cpp /Fobuild\temp.win-amd64-cpython-310\Release\fairseq/clib/libbleu/libbleu.obj -std=c++11 -O3 cl : Command line warning D9002 : ignoring unknown option '-std=c++11' cl : Command line warning D9002 : ignoring unknown option '-O3' libbleu.cpp fairseq/clib/libbleu/libbleu.cpp(96): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data fairseq/clib/libbleu/libbleu.cpp(102): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Python310\include -IC:\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\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" /EHsc /Tpfairseq/clib/libbleu/module.cpp /Fobuild\temp.win-amd64-cpython-310\Release\fairseq/clib/libbleu/module.obj -std=c++11 -O3 cl : Command line warning D9002 : ignoring unknown option '-std=c++11' cl : Command line warning D9002 : ignoring unknown option '-O3' module.cpp "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Python310\libs /LIBPATH:C:\Python310 /LIBPATH:C:\Python310\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\um\x64" /EXPORT:PyInit_libbleu build\temp.win-amd64-cpython-310\Release\fairseq/clib/libbleu/libbleu.obj build\temp.win-amd64-cpython-310\Release\fairseq/clib/libbleu/module.obj /OUT:build\lib.win-amd64-cpython-310\fairseq\libbleu.cp310-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-310\Release\fairseq/clib/libbleu\libbleu.cp310-win_amd64.lib LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj' error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\link.exe' failed with exit code 1181 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for fairseq Failed to build fairseq ERROR: Could not build wheels for fairseq, which is required to install pyproject.toml-based projects

C:\Windows\system32>`

BUZZARDGTA commented 1 year ago

You can try installing Visual Studio, and select the first "Desktop development with C++" option there: https://visualstudio.microsoft.com/visual-cpp-build-tools/

kevin-guimard-ext commented 1 year ago

I also have an error with the linker but with the error code 1120: build\lib.win32-cpython-310\fairseq\libbleu.cp310-win_amd64.pyd : fatal error LNK1120: 1 resolved externals I installed the C++ development tools v14.37.32822.