简体   繁体   English

fasttext 安装过程中出错。 怎么修?

[英]Error during fasttext installation. How to fix?

I am trying to install fasttext on Windows 10, but keep getting an error.我正在尝试在 Windows 10 上安装 fasttext,但一直出现错误。 VC with C++ compiler and other requirements are installed.安装了C++编译器和其他要求的VC。 Please, help!请帮忙!

The error (only last rows, the error log is very long):错误(只有最后一行,错误日志很长):

    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:64:1: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:68:1: error: 'constexpr' does not name a type
     constexpr enable_if_t<!B, descr<N2 - 1>> _(char const(&)[N1], char const(&text2)[N2]) {
     ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:68:1: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:73:1: error: 'constexpr' does not name a type
     constexpr enable_if_t<B, T1> _(const T1 &d, const T2 &) { return d; }
     ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:73:1: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:75:1: error: 'constexpr' does not name a type
     constexpr enable_if_t<!B, T2> _(const T1 &, const T2 &d) { return d; }
     ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:75:1: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:77:24: warning: 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]
     template <size_t Size> auto constexpr _() -> decltype(int_to_str<Size / 10, Size % 10>::digits) {
                            ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:77:29: error: 'constexpr' does not name a type
     template <size_t Size> auto constexpr _() -> decltype(int_to_str<Size / 10, Size % 10>::digits) {
                                 ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:77:29: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:81:26: error: 'constexpr' does not name a type
     template <typename Type> constexpr descr<1, Type> _() { return {'%'}; }
                              ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:81:26: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:83:1: error: 'constexpr' does not name a type
     constexpr descr<0> concat() { return {}; }
     ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:83:1: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:85:29: warning: variadic templates only available with -std=c++11 or -std=gnu++11
     template <size_t N, typename... Ts>
                                 ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:86:1: error: 'constexpr' does not name a type
     constexpr descr<N, Ts...> concat(const descr<N, Ts...> &descr) { return descr; }
     ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:86:1: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:88:29: warning: variadic templates only available with -std=c++11 or -std=gnu++11
     template <size_t N, typename... Ts, typename... Args>
                                 ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:88:45: warning: variadic templates only available with -std=c++11 or -std=gnu++11
     template <size_t N, typename... Ts, typename... Args>
                                                 ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:89:1: error: 'constexpr' does not name a type
     constexpr auto concat(const descr<N, Ts...> &d, const Args &...args)
     ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:89:1: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:94:29: warning: variadic templates only available with -std=c++11 or -std=gnu++11
     template <size_t N, typename... Ts>
                                 ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:95:1: error: 'constexpr' does not name a type
     constexpr descr<N + 2, Ts...> type_descr(const descr<N, Ts...> &descr) {
     ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/descr.h:95:1: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
    In file included from D:\Python\lib\site-packages\pybind11\include/pybind11/cast.h:16:0,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/attr.h:13,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/pybind11.h:44,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/numpy.h:12,
                     from python/fasttext_module/fasttext/pybind/fasttext_pybind.cc:13:
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:58:7: error: expected nested-name-specifier before 'type_hash'
     using type_hash = std::hash<std::type_index>;
           ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:59:7: error: expected nested-name-specifier before 'type_equal_to'
     using type_equal_to = std::equal_to<std::type_index>;
           ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:83:1: error: expected unqualified-id before 'using'
     using type_map = std::unordered_map<std::type_index, value_type, type_hash, type_equal_to>;
     ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h: In member function 'size_t pybind11::detail::overload_hash::operator()(const std::pair<const _object*, const char*>&) const':
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:87:24: error: 'hash' is not a member of 'std'
             size_t value = std::hash<const void *>()(v.first);
                            ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:87:24: note: suggested alternative:
    In file included from D:\Python\lib\site-packages\pybind11\include/pybind11/cast.h:13:0,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/attr.h:13,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/pybind11.h:44,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/numpy.h:12,
                     from python/fasttext_module/fasttext/pybind/fasttext_pybind.cc:13:
    D:\Python\lib\site-packages\pybind11\include/pybind11/pytypes.h:441:16: note:   'pybind11::hash'
     inline ssize_t hash(handle obj) {
                    ^
    In file included from D:\Python\lib\site-packages\pybind11\include/pybind11/cast.h:16:0,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/attr.h:13,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/pybind11.h:44,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/numpy.h:12,
                     from python/fasttext_module/fasttext/pybind/fasttext_pybind.cc:13:
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:87:34: error: expected primary-expression before 'const'
             size_t value = std::hash<const void *>()(v.first);
                                      ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:88:18: error: 'hash' is not a member of 'std'
             value ^= std::hash<const void *>()(v.second)  + 0x9e3779b9 + (value<<6) + (value>>2);
                      ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:88:18: note: suggested alternative:
    In file included from D:\Python\lib\site-packages\pybind11\include/pybind11/cast.h:13:0,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/attr.h:13,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/pybind11.h:44,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/numpy.h:12,
                     from python/fasttext_module/fasttext/pybind/fasttext_pybind.cc:13:
    D:\Python\lib\site-packages\pybind11\include/pybind11/pytypes.h:441:16: note:   'pybind11::hash'
     inline ssize_t hash(handle obj) {
                    ^
    In file included from D:\Python\lib\site-packages\pybind11\include/pybind11/cast.h:16:0,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/attr.h:13,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/pybind11.h:44,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/numpy.h:12,
                     from python/fasttext_module/fasttext/pybind/fasttext_pybind.cc:13:
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:88:28: error: expected primary-expression before 'const'
             value ^= std::hash<const void *>()(v.second)  + 0x9e3779b9 + (value<<6) + (value>>2);
                                ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h: At global scope:
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:97:5: error: 'type_map' does not name a type
         type_map<type_info *> registered_types_cpp; // std::type_index -> pybind11's type information
         ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:98:10: error: 'unordered_map' in namespace 'std' does not name a template type
         std::unordered_map<PyTypeObject *, std::vector<type_info *>> registered_types_py; // PyTypeObject* -> base type_info(s)
              ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:99:10: error: 'unordered_multimap' in namespace 'std' does not name a template type
         std::unordered_multimap<const void *, instance*> registered_instances; // void * -> instance*
              ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:100:10: error: 'unordered_set' in namespace 'std' does not name a template type
         std::unordered_set<std::pair<const PyObject *, const char *>, overload_hash> inactive_overload_cache;
              ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:101:5: error: 'type_map' does not name a type
         type_map<std::vector<bool (*)(PyObject *, void *&)>> direct_conversions;
         ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:102:10: error: 'unordered_map' in namespace 'std' does not name a template type
         std::unordered_map<const PyObject *, std::vector<PyObject *>> patients;
              ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:103:10: error: 'forward_list' in namespace 'std' does not name a template type
         std::forward_list<void (*) (std::exception_ptr)> registered_exception_translators;
              ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:104:10: error: 'unordered_map' in namespace 'std' does not name a template type
         std::unordered_map<std::string, void *> shared_data; // Custom data to be shared across extensions
              ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:106:10: error: 'forward_list' in namespace 'std' does not name a template type
         std::forward_list<std::string> static_strings; // Stores the std::strings backing detail::c_str()
              ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:24:56: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
     #    define PYBIND11_TLS_KEY_INIT(var) Py_tss_t *var = nullptr
                                                            ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:111:5: note: in expansion of macro 'PYBIND11_TLS_KEY_INIT'
         PYBIND11_TLS_KEY_INIT(tstate);
         ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:112:34: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
         PyInterpreterState *istate = nullptr;
                                      ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:24:56: error: 'nullptr' was not declared in this scope
     #    define PYBIND11_TLS_KEY_INIT(var) Py_tss_t *var = nullptr
                                                            ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:111:5: note: in expansion of macro 'PYBIND11_TLS_KEY_INIT'
         PYBIND11_TLS_KEY_INIT(tstate);
         ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:112:34: error: 'nullptr' was not declared in this scope
         PyInterpreterState *istate = nullptr;
                                      ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:136:68: error: '>>' should be '> >' within a nested template argument list
         std::vector<std::pair<const std::type_info *, void *(*)(void *)>> implicit_casts;
                                                                        ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:138:54: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
         buffer_info *(*get_buffer)(PyObject *, void *) = nullptr;
                                                          ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:139:29: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
         void *get_buffer_data = nullptr;
                                 ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:140:65: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
         void *(*module_local_load)(PyObject *, const type_info *) = nullptr;
                                                                     ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:138:54: error: 'nullptr' was not declared in this scope
         buffer_info *(*get_buffer)(PyObject *, void *) = nullptr;
                                                          ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:139:29: error: 'nullptr' was not declared in this scope
         void *get_buffer_data = nullptr;
                                 ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:140:65: error: 'nullptr' was not declared in this scope
         void *(*module_local_load)(PyObject *, const type_info *) = nullptr;
                                                                     ^
    In file included from D:\Python\lib\site-packages\pybind11\include/pybind11/cast.h:16:0,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/attr.h:13,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/pybind11.h:44,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/numpy.h:12,
                     from python/fasttext_module/fasttext/pybind/fasttext_pybind.cc:13:
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h: In function 'pybind11::detail::internals**& pybind11::detail::get_internals_pp()':
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:211:39: error: 'nullptr' was not declared in this scope
         static internals **internals_pp = nullptr;
                                           ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h: At global scope:
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:215:38: error: variable or field 'translate_exception' declared void
     inline void translate_exception(std::exception_ptr p) {
                                          ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/detail/internals.h:215:33: error: 'exception_ptr' is not a member of 'std'
     inline void translate_exception(std::exception_ptr p) {
                                     ^
    In file included from D:\Python\lib\site-packages\pybind11\include/pybind11/numpy.h:12:0,
                     from python/fasttext_module/fasttext/pybind/fasttext_pybind.cc:13:
    D:\Python\lib\site-packages\pybind11\include/pybind11/pybind11.h:2182:29: error: expected '}' before end of line
    D:\Python\lib\site-packages\pybind11\include/pybind11/pybind11.h:2182:29: error: expected '}' before end of line
    D:\Python\lib\site-packages\pybind11\include/pybind11/pybind11.h:2182:29: error: expected declaration before end of line
    In file included from D:\Python\lib\site-packages\pybind11\include/pybind11/cast.h:13:0,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/attr.h:13,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/pybind11.h:44,
                     from D:\Python\lib\site-packages\pybind11\include/pybind11/numpy.h:12,
                     from python/fasttext_module/fasttext/pybind/fasttext_pybind.cc:13:
    D:\Python\lib\site-packages\pybind11\include/pybind11/pytypes.h:315:20: warning: inline function 'std::__cxx11::string pybind11::detail::error_string()' used but never defined
     inline std::string error_string();
                        ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/pytypes.h:333:12: warning: inline function 'virtual pybind11::error_already_set::~error_already_set()' used but never defined
         inline ~error_already_set();
                ^
    D:\Python\lib\site-packages\pybind11\include/pybind11/pytypes.h:333:12: warning: inline function 'virtual pybind11::error_already_set::~error_already_set()' used but never defined
    error: command 'D:\\Python\\Library\\mingw-w64\\bin\\gcc.exe' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\Python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Temp\\pip-install-0n3qmnq1\\fasttext\\setup.py'"'"'; __file__='"'"'C:\\Temp\\pip-install-0n3qmnq1\\fasttext\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Temp\pip-record-5i0r9517\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

Tried to use pip install fasttext-win.尝试使用 pip 安装 fasttext-win。 Installation was successful, but when I am trying to do simple commands, like fasttext.model.from_unsupervised I am getting an error that there is no such function.安装成功,但是当我尝试执行简单的命令时,例如 fasttext.model.from_unsupervised 我收到一个错误,即没有这样的 function。 I think this module is not what I am looking for.我认为这个模块不是我想要的。

For windows use gensim library.对于 windows 使用 gensim 库。

I recomend you use mac or linux to run process with fasttext.我建议您使用 mac 或 linux 使用 fasttext 运行进程。

In mac or linux you can install fasttext with no problems:在 mac 或 linux 中,您可以毫无问题地install fasttext

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我尝试为 python (linux) 安装 emcee 和 corner。 我在安装过程中丢失了“python.h”。 转角安装如何解决? - I tried to install emcee and corner for python (linux). I got missing 'python.h' during installation. How to fix the corner installation? 如何修复pythonnet安装期间的错误 - How to fix error during pythonnet installation 在“npm jsbin”安装过程中找不到 Python 作为依赖项。 有什么不见了? - Python not found as dependency during ' npm jsbin' installation. What is missing? 错误“ImportError:错误:在加载“cv2”二进制扩展时检测到递归。检查 OpenCV 安装。” 使用 Pyinstaller - Error "ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation." with Pyinstaller Numpy 导入错误“ImportError:numpy 安装出现问题。” - Numpy import error “ImportError: Something is wrong with the numpy installation.” 有没有办法在安装过程中修复 ReadTimed out 错误? - Is there a way to fix ReadTimed out error during installation process? 如何通过子进度上的pybuez错误修复安装错误 - How to fix installation error by pybuez error on subprogress fastText 安装失败 - fastText installation failed Scarpy 安装错误。 如何解决? - Scarpy Installation Error. How to fix it? 如何修复 PyQt6-tools 安装错误? - How to fix PyQt6-tools installation error?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM