-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Installing fastText on Windows fails with C++ errors #1277
Comments
I also have the same problem. Then, I tried to install gensim to see if I could even load the Japanese pretrained model for fasttext, but it brings me other problems. If you are dealing with english language, try to use gensim, it might work. See this link. |
@suzana-rita someone told me about spaCy and that's what I use now. |
It also occurs when trying to install other packages that have fasttext as dependency. |
It is evident from multiple sources on the web that building or installing the fasttext python wrapper on Windows is very problematical for many people, with multiple issues being seen over the years. Please can this be tidied up and properly documented AND please can install/build on Windows be part of continuous testing. |
yes |
I have encountered the same error and solved it as follows: download fasttext wheel from: https://www.lfd.uci.edu/~gohlke/pythonlibs/#fasttext (in my case : fasttext-0.9.2-cp39-cp39-win_amd64.whl) then : pip install fasttext-0.9.2-cp39-cp39-win_amd64.whl |
@ht21992 thanks for your suggestion - How do you determine which wheel to attempt; I keep getting the following errors. TIA ERROR: fasttext-0.9.2-cp39-cp39-win_amd64.whl is not a supported wheel on this platform. (base) c:\GitPublic>pip install fasttext-0.9.2-pp38-pypy38_pp73-win_amd64.whl (base) c:\GitPublic>pip install fasttext-0.9.2-cp39-cp39-win32 |
fasttext-0.9.2: This is the version of the FastText library. To resolve this issue you must check Python Version and Architecture. If you are using a 32-bit Python, you will need to find a wheel built for a 32-bit architecture |
@ht21992 - Thank you for the feedback |
Since the links seem to be down as of today, here's a zipped version of the wheel for Windows and python 3.11, I found |
I just followed the instructions to build and install the Python module (https://fasttext.cc/docs/en/support.html) and the installation fails with C++ errors:
`C:\Users\moonman239\fastText>pip install .
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
Processing c:\users\moonman239\fasttext
Preparing metadata (setup.py) ... done
Requirement already satisfied: pybind11>=2.2 in c:\python310\lib\site-packages (from fasttext==0.9.2) (2.9.2)
Requirement already satisfied: setuptools>=0.7.0 in c:\python310\lib\site-packages (from fasttext==0.9.2) (58.1.0)
Requirement already satisfied: numpy in c:\python310\lib\site-packages (from fasttext==0.9.2) (1.22.3)
Building wheels for collected packages: fasttext
Building wheel for fasttext (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
C:\Python310\lib\site-packages\setuptools\dist.py:717: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
running bdist_wheel
running build
running build_py
running build_ext
building 'fasttext_pybind' extension
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Python310\lib\site-packages\pybind11\include -IC:\Python310\lib\site-packages\pybind11\include -Isrc -IC:\Python310\include -IC:\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /EHsc /Tppython/fasttext_module/fasttext/pybind/fasttext_pybind.cc /Fobuild\temp.win-amd64-3.10\Release\python/fasttext_module/fasttext/pybind/fasttext_pybind.obj /EHsc /DVERSION_INFO="0.9.2"
fasttext_pybind.cc
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2065: 'ssize_t': undeclared identifier
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2672: 'pybind11::init': no matching overloaded function found
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(170): error C2974: 'pybind11::init': invalid template argument for 'CFunc', type expected
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1920): note: see declaration of 'pybind11::init'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(170): error C2974: 'pybind11::init': invalid template argument for 'Func', type expected
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1912): note: see declaration of 'pybind11::init'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(170): error C2974: 'pybind11::init': invalid template argument for 'Args', type expected
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1900): note: see declaration of 'pybind11::init'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2672: 'pybind11::class_fasttext::Vector::def': no matching overloaded function found
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(170): error C2780: 'pybind11::class_fasttext::Vector &pybind11::class_fasttext::Vector::def(const char *,Func &&,const Extra &...)': expects 3 arguments - 1 provided
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1577): note: see declaration of 'pybind11::class_fasttext::Vector::def'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): error C2065: 'ssize_t': undeclared identifier
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): error C2065: 'ssize_t': undeclared identifier
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): error C2672: 'pybind11::init': no matching overloaded function found
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(182): error C2974: 'pybind11::init': invalid template argument for 'CFunc', type expected
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1920): note: see declaration of 'pybind11::init'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(182): error C2974: 'pybind11::init': invalid template argument for 'Func', type expected
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1912): note: see declaration of 'pybind11::init'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(182): error C2974: 'pybind11::init': invalid template argument for 'Args', type expected
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1900): note: see declaration of 'pybind11::init'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): error C2672: 'pybind11::class_fasttext::DenseMatrix::def': no matching overloaded function found
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(182): error C2780: 'pybind11::class_fasttext::DenseMatrix &pybind11::class_fasttext::DenseMatrix::def(const char *,Func &&,const Extra &...)': expects 3 arguments - 1 provided
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1577): note: see declaration of 'pybind11::class_fasttext::DenseMatrix::def'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\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 fasttext
Running setup.py clean for fasttext
Failed to build fasttext
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
Installing collected packages: fasttext
Running setup.py install for fasttext ... error
error: subprocess-exited-with-error
× Running setup.py install for fasttext did not run successfully.
│ exit code: 1
╰─> [52 lines of output]
C:\Python310\lib\site-packages\setuptools\dist.py:717: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
creating build\lib.win-amd64-3.10\fasttext
copying python\fasttext_module\fasttext\FastText.py -> build\lib.win-amd64-3.10\fasttext
copying python\fasttext_module\fasttext_init_.py -> build\lib.win-amd64-3.10\fasttext
creating build\lib.win-amd64-3.10\fasttext\util
copying python\fasttext_module\fasttext\util\util.py -> build\lib.win-amd64-3.10\fasttext\util
copying python\fasttext_module\fasttext\util_init_.py -> build\lib.win-amd64-3.10\fasttext\util
creating build\lib.win-amd64-3.10\fasttext\tests
copying python\fasttext_module\fasttext\tests\test_configurations.py -> build\lib.win-amd64-3.10\fasttext\tests
copying python\fasttext_module\fasttext\tests\test_script.py -> build\lib.win-amd64-3.10\fasttext\tests
copying python\fasttext_module\fasttext\tests_init_.py -> build\lib.win-amd64-3.10\fasttext\tests
running build_ext
building 'fasttext_pybind' extension
creating build\temp.win-amd64-3.10
creating build\temp.win-amd64-3.10\Release
creating build\temp.win-amd64-3.10\Release\python
creating build\temp.win-amd64-3.10\Release\python\fasttext_module
creating build\temp.win-amd64-3.10\Release\python\fasttext_module\fasttext
creating build\temp.win-amd64-3.10\Release\python\fasttext_module\fasttext\pybind
creating build\temp.win-amd64-3.10\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Python310\lib\site-packages\pybind11\include -IC:\Python310\lib\site-packages\pybind11\include -Isrc -IC:\Python310\include -IC:\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /EHsc /Tppython/fasttext_module/fasttext/pybind/fasttext_pybind.cc /Fobuild\temp.win-amd64-3.10\Release\python/fasttext_module/fasttext/pybind/fasttext_pybind.obj /EHsc /DVERSION_INFO="0.9.2"
fasttext_pybind.cc
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2065: 'ssize_t': undeclared identifier
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2672: 'pybind11::init': no matching overloaded function found
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(170): error C2974: 'pybind11::init': invalid template argument for 'CFunc', type expected
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1920): note: see declaration of 'pybind11::init'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(170): error C2974: 'pybind11::init': invalid template argument for 'Func', type expected
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1912): note: see declaration of 'pybind11::init'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(170): error C2974: 'pybind11::init': invalid template argument for 'Args', type expected
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1900): note: see declaration of 'pybind11::init'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2672: 'pybind11::class_fasttext::Vector::def': no matching overloaded function found
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(170): error C2780: 'pybind11::class_fasttext::Vector &pybind11::class_fasttext::Vector::def(const char *,Func &&,const Extra &...)': expects 3 arguments - 1 provided
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1577): note: see declaration of 'pybind11::class_fasttext::Vector::def'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): error C2065: 'ssize_t': undeclared identifier
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): error C2065: 'ssize_t': undeclared identifier
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): error C2672: 'pybind11::init': no matching overloaded function found
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(182): error C2974: 'pybind11::init': invalid template argument for 'CFunc', type expected
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1920): note: see declaration of 'pybind11::init'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(182): error C2974: 'pybind11::init': invalid template argument for 'Func', type expected
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1912): note: see declaration of 'pybind11::init'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(182): error C2974: 'pybind11::init': invalid template argument for 'Args', type expected
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1900): note: see declaration of 'pybind11::init'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): error C2672: 'pybind11::class_fasttext::DenseMatrix::def': no matching overloaded function found
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(182): error C2780: 'pybind11::class_fasttext::DenseMatrix &pybind11::class_fasttext::DenseMatrix::def(const char *,Func &&,const Extra &...)': expects 3 arguments - 1 provided
C:\Python310\lib\site-packages\pybind11\include\pybind11\pybind11.h(1577): note: see declaration of 'pybind11::class_fasttext::DenseMatrix::def'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\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: legacy-install-failure
× Encountered error while trying to install package.
╰─> fasttext
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
`
The text was updated successfully, but these errors were encountered: