繁体   English   中英

在 Mac 上安装 pyfastext 时出错:命令“cc”失败,退出状态为 1

[英]Got error on installing pyfastext on Mac: command 'cc' failed with exit status 1

我刚刚在安装 pyfasttext 时出错。

cogent@MBP: pip install --user pyfasttext          

然后我得到了这些:

Collecting pyfasttext Downloading https://files.pythonhosted.org/packages/f5/ef/90606442481d1e4ab10eba8c2b2c449ceaa70c60e9b8d5898bb7504e3634/pyfasttext-0.4.6.tar.gz (244kB) 100% |██████████████ ██████████████████| 245kB 224kB/s 已满足要求:/Users/cogent/Library/Python/2.7/lib/python/site-packages 中的未来(来自 pyfasttext)(0.18.1) 已满足要求:/Users/cogent/Library/ 中的 cysignals Python/2.7/lib/python/site-packages(来自 pyfasttext)(1.10.2)要求已经满足:/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python 中的 numpy(来自 pyfasttext) (1.8.0rc1)要求已经满足:/Library/Python/2.7/site-packages 中的 Cython>=0.28(来自 cysignals->pyfasttext)(0.29.13)安装收集的包:pyfasttext 运行 setup.py install for pyfasttext.. . 错误 Complete output from command /usr/bin/python -u -c "import setuptools, tokenize; file ='/private/var/folders/gm/kpbf6gyx1dx_167zbp2gmdym0000gn/T/pip-install-wuuXwu/pyfasttext/setup.py' ;f=getattr(tokenize, 'open', open)( file );code=f.read().replace('\r\n', '\n');f.close();exec(compile(代码、文件、'exec'))" 安装 -- 记录 /private/var/folders/gm/kpbf6gyx1dx_167zbp2gmdym0000gn/T/pip-record-Qtcina/install-record.txt --single-version-externally-managed --compile --user --prefix=: running install running build running build_ext building 'pyfasttext' extension 创建 build 创建 build/temp.macosx-10.14-intel-2.7 创建 build/temp.macosx-10.14-intel-2.7/src 创建 build/temp.macosx-10.14-intel-2.7/src/fastText创建 build/temp.macosx-10.14-intel-2.7/src/fastText/src cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -iquote。 -include src/custom_exit.h -arch i386 -arch x86_64 -pipe -Isrc -I/Users/cogent/Library/Python/2.7/lib/python/site-packages/cysignals -I。 -Isrc/variant/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python /numpy/core/include -c src/pyfasttext.cpp -o build/temp.macosx-10.14-intel-2.7/src/pyfasttext.o -Wno-sign-compare -std=c++0x 在 src 包含的文件中/pyfasttext.cpp:53:在 /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85 包含的文件中:/System/Library/Frameworks/Python.framework/Versions /2.7/include/python2.7/unicodeobject.h:534:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register PyObject obj, / Object */ ^~~~~ ~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:553:5:警告:“注册”存储 class 说明符已弃用且不兼容 C++17 [-Wdeprecated-register] register PyObject obj / Object */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:575: 5:警告:'register' storage class 说明符已弃用且与 C++17 [-Wdeprecated-register] register const wchar_t w, / wchar_t buffer */ ^~~~~~~~~ /System/Library/Frameworks/Python 不兼容。 framework/Versions/2.7/include/python2.7/unicodeobject.h:593:5: warning: 'register' storage class 说明符已弃用且与 C++17 [-Wdeprecated-register] register wchar_t w, / wchar_t 不兼容~~~~~~~~ 在 src/pyfasttext.cpp:53 包含的文件中:在 /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:94 包含的文件中:/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/ stringobject.h:173:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register PyObject obj, / string or Unicode object */ ^~~~~~~~~ /System /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:174:5:警告:“注册”存储 class 说明符已弃用且与 C++17 [-Wdeprecated-register] 寄存器不兼容*s, /* 指向缓冲区变量的指针 */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:175:5: 警告: 'register' 存储 class 说明符已弃用,并且与 C++17 [-Wdeprecated-register] 寄存器 Py_ssize_t len /指向长度变量的指针或 Z6C3E226^B4D4795D518AB341B0~~~~~~EC298 不兼容在 src/pyfasttext.cpp:676 中包含的文件中:在 /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/arrayobject.h:4 中包含的文件中:在/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarrayobject.h:17 中包含的文件中:在/System/Library/Frameworks 中包含的文件中/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarraytypes.h:1760:/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/ numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings] #warning "Using deprecated NumPy API, disable it由 " \ ^ 生成 8 个警告。 在 src/pyfasttext.cpp:53 中包含的文件中:在 /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85 中包含的文件中:/System/Library/Frameworks/ Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:534:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register PyObject obj, / Object */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:553:5: 警告:“注册”存储 class 说明符已弃用且不兼容使用 C++17 [-Wdeprecated-register] 注册 PyObject obj / Object */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:575 :5: 警告:“注册”存储 class 规范 er 已弃用且与 C++17 [-Wdeprecated-register] register const wchar_t w, / wchar_t buffer */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2 不兼容.7/unicodeobject.h:593:5: warning: 'register' storage class specifier is deprecated and in compatible with C++17 [-Wdeprecated-register] register wchar_t w, / wchar_~~~~~~ In src/pyfasttext.cpp:53 中包含的文件:/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:94 中包含的文件:/System/Library/Frameworks/Python .framework/Versions/2.7/include/python2.7/stringobject.h:173:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register PyObject obj, / string or Unicode object */ ^~ ~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:174:5: warning: 'register' storage class 说明符已弃用且与 C++17 不兼容[-Wdeprecated-register] register char **s, /* 指向缓冲区变量的指针 */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/ stringobject.h:175:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register Py_ssize_t len / pointer to length variable or NULL ^~~~~~~~~ In file included来自 src/pyfasttext.cpp:676:在 /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/arrayobject.h:4 中包含的文件中:在文件中包含在 /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/includ e/numpy/ndarrayobject.h:17:在 /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarraytypes.h:1760 中包含的文件中:/ System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: 警告:“使用已弃用的 NumPy ZDB974238714CA8DE634A7CE10”禁用它定义 NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings] #warning "使用已弃用的 NumPy API,通过 " \ ^ 禁用它生成 8 个警告。 cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -iquote。 -include src/custom_exit.h -arch i386 -arch x86_64 -pipe -Isrc -I/Users/cogent/Library/Python/2.7/lib/python/site-packages/cysignals -I。 -Isrc/variant/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python /numpy/core/include -c src/fasttext_access.cpp -o build/temp.macosx-10.14-intel-2.7/src/fasttext_access.o -Wno-sign-compare -std=c++0x src/fasttext_access.cpp :43:1: 错误:非类型模板参数不是指向成员常量 ALLOW_METHOD_ACCESS(FastText, bool, checkModel, std::istream&); 的指针 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ src/private_access.h:55:38: 注意: 扩展自宏 'ALLOW_METHOD_ACCESS' 模板结构 rob ^~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/fasttext_access.cpp:54:1: error: non-type template argument is不是指向成员常量 ALLOW_CONST_METHOD_ACCESS(Dictionary, int32_t, find, const std::string&); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ src/private_access.h:59:38: 注意: 扩展自宏 'ALLOW_CONST_METHOD_ACCESS' 模板结构 rob ^~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/ fasttext_access.cpp:55:1: 错误:非类型模板参数不是指向成员常量 ALLOW_CONST_METHOD_ACCESS(Dictionary, void, pushHash, std::vector&, int32_t) 的指针; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/private_access.h:59:38: 注意:从宏扩展'ALLOW_CONST_METHOD_ACCESS' 模板结构 rob ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ src/fasttext_access.cpp:56:1: 错误:非类型模板参数不是指向成员常量 ALLOW_METHOD_ACCESS(Dictionary, void, initTableDiscard, ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ src/private_access.h:55:38: 注意: 扩展自宏 'ALLOW_METHOD_ACCESS' 模板结构 rob ^~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/fasttext_access.cpp:57:1: 错误:非类型模板参数不是指向成员的指针常量 ALLOW_METHOD_ACCESS(字典, void, initNgrams, ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ src/private_access.h:55:38: 注意: 扩展自宏 'ALLOW_METHOD_ACCESS' 模板结构 rob ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ 产生5个错误。 错误:命令“cc”失败,退出状态为 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/gm/kpbf6gyx1dx_167zbp2gmdym0000gn/T/pip-install-wuuXwu/pyfasttext/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/gm/kpbf6gyx1dx_167zbp2gmdym0000gn/T/pip-record-Qtcina/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /private/var/folders/gm/kpbf6gyx1dx_167zbp2gmdym0000gn/T/pip-install-wuuXwu/pyfasttext/

为什么我收到这些消息? 有什么想法吗?非常感谢!

根据这个答案, PyFastText 不再维护。

您可以改为使用:

pip install fastText

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM