facebookresearch / fastText

Library for fast text representation and classification.
https://fasttext.cc/
MIT License
25.76k stars 4.71k forks source link

Failed install #1364

Open FaresRe1 opened 5 months ago

FaresRe1 commented 5 months ago

Hey, Im trying to install fasttext onto VSCode for a deeppavlov system im developing. Whenever I do pip install fasttext, i get the error message shown below. Am i installing it wrong or what do I do to fix it.

Thank you

`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 ╰─> [75 lines of output] python/fasttext_module/fasttext/pybind/fasttextpybind.cc(185): note: 'pybind11::class &pybind11::class_::def(const char *,Func &&,const Extra &...)': expects 3 arguments - 1 provided error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\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 ERROR: Could not build wheels for fasttext, which is required to install pyproject.toml-based projects`

swight-prc commented 4 months ago

I ran into what seems like a similar problem. This appears to be distribution-dependent. It does not happen on a debian-based container I was also working in.

edit: I should mention, I tried this at HEAD and at latest.

Full output:

      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(40): error C2039: 'string_view': is not a member of 'std'
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\unordered_map(24): note: see declaration of 'std'
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(40): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(41): error C2039: 'string_view': is not a member of 'std'
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\unordered_map(24): note: see declaration of 'std'
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(41): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(46): error C2039: 'string_view': is not a member of 'std'
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\unordered_map(24): note: see declaration of 'std'
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(46): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(75): error C2039: 'string_view': is not a member of 'std'
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\unordered_map(24): note: see declaration of 'std'
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(75): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(76): error C2039: 'string_view': is not a member of 'std'
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\unordered_map(24): note: see declaration of 'std'
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(76): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(78): error C2039: 'string_view': is not a member of 'std'
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\unordered_map(24): note: see declaration of 'std'
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(78): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(78): error C2535: 'fasttext::entry_type fasttext::Dictionary::getType(int32_t) const': member function already defined or declared
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(77): note: see declaration of 'fasttext::Dictionary::getType'
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(91): error C2039: 'string_view': is not a member of 'std'
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\unordered_map(24): note: see declaration of 'std'
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(91): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(91): error C2146: syntax error: missing ')' before identifier 'str'
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(91): error C3646: 'str': unknown override specifier
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(91): error C2059: syntax error: ')'
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(91): error C2143: syntax error: missing ';' before 'const'
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(91): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(91): error C2208: 'const int': no members defined using this type
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(91): warning C4091: ' ': ignored on left of 'const int' when no variable is declared
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(103): error C2039: 'string_view': is not a member of 'std'
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\unordered_map(24): note: see declaration of 'std'
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(103): error C2061: syntax error: identifier 'string_view'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(71): error C2662: 'uint32_t fasttext::Dictionary::hash(const int)': cannot convert 'this' pointer from '_Ty2' to 'fasttext::Dictionary &'
              with
              [
                  _Ty2=const fasttext::Dictionary
              ]
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(71): note: Conversion loses qualifiers
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(91): note: see declaration of 'fasttext::Dictionary::hash'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(72): error C2664: 'int32_t fasttext::Dictionary::getId(const int,uint32_t) const': cannot convert argument 1 from 'std::string' to 'const int'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(72): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(76): note: see declaration of 'fasttext::Dictionary::getId'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(73): error C2664: 'fasttext::entry_type fasttext::Dictionary::getType(int32_t) const': cannot convert argument 1 from 'std::string' to 'int32_t'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(73): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
      C:\Users\thisuser\Projects\currProj\fastText\src\dictionary.h(77): note: see declaration of 'fasttext::Dictionary::getType'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(172): error C2065: 'ssize_t': undeclared identifier
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(172): error C2672: 'pybind11::init': no matching overloaded function found
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2974: 'pybind11::init': invalid template argument for 'CFunc', type expected
      C:\Users\thisuser\AppData\Local\Temp\pip-build-env-ybmhzyye\overlay\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1932): note: see declaration of 'pybind11::init'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2974: 'pybind11::init': invalid template argument for 'Func', type expected
      C:\Users\thisuser\AppData\Local\Temp\pip-build-env-ybmhzyye\overlay\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1924): note: see declaration of 'pybind11::init'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2974: 'pybind11::init': invalid template argument for 'Args', type expected
      C:\Users\thisuser\AppData\Local\Temp\pip-build-env-ybmhzyye\overlay\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1912): note: see declaration of 'pybind11::init'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(172): error C2672: 'pybind11::class_<fasttext::Vector>::def': no matching overloaded function found
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2780: 'pybind11::class_<fasttext::Vector> &pybind11::class_<fasttext::Vector>::def(const char *,Func &&,const Extra &...)': expects 3 arguments - 1 provided
      C:\Users\thisuser\AppData\Local\Temp\pip-build-env-ybmhzyye\overlay\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1574): note: see declaration of 'pybind11::class_<fasttext::Vector>::def'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(186): error C2065: 'ssize_t': undeclared identifier
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(186): error C2065: 'ssize_t': undeclared identifier
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(186): error C2672: 'pybind11::init': no matching overloaded function found
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(183): error C2974: 'pybind11::init': invalid template argument for 'CFunc', type expected
      C:\Users\thisuser\AppData\Local\Temp\pip-build-env-ybmhzyye\overlay\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1932): note: see declaration of 'pybind11::init'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(183): error C2974: 'pybind11::init': invalid template argument for 'Func', type expected
      C:\Users\thisuser\AppData\Local\Temp\pip-build-env-ybmhzyye\overlay\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1924): note: see declaration of 'pybind11::init'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(183): error C2974: 'pybind11::init': invalid template argument for 'Args', type expected
      C:\Users\thisuser\AppData\Local\Temp\pip-build-env-ybmhzyye\overlay\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1912): note: see declaration of 'pybind11::init'
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(186): error C2672: 'pybind11::class_<fasttext::DenseMatrix>::def': no matching overloaded function found
      python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(183): error C2780: 'pybind11::class_<fasttext::DenseMatrix> &pybind11::class_<fasttext::DenseMatrix>::def(const char *,Func &&,const Extra &...)': expects 3 arguments - 1 provided
      C:\Users\thisuser\AppData\Local\Temp\pip-build-env-ybmhzyye\overlay\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1574): note: see declaration of 'pybind11::class_<fasttext::DenseMatrix>::def'      
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29910\\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
Failed to build fasttext
ERROR: Could not build wheels for fasttext, which is required to install pyproject.toml-based projects