首页 > 解决方案 > 在 Mac 上安装 pyfastext 时出错:命令“cc”失败,退出状态为 1

问题描述

我刚刚在安装 pyfasttext 时出错。

cogent@MBP: pip install --user pyfasttext          

然后我得到了这些:

收集 pyfasttext 下载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 .. . 错误命令 /usr/bin/python -u -c "import setuptools, tokenize;文件的完整输出='/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=: 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:警告:'register' 存储类说明符已弃用并且与 C++17 [-Wdeprecated-register] register PyObject 不兼容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: 警告:'register' 存储类说明符已弃用且与 C++17 [-Wdeprecated-register] register PyObject 不兼容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: 警告:'register' 存储类说明符已弃用且与 C++17 [-Wdeprecated-register] register PyObject 不兼容7/Python.h:85:/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:534:5:警告:“注册”存储类说明符已弃用且不兼容C++17 [-Wdeprecated-register] 注册 PyObject7/Python.h:85:/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:534:5:警告:“注册”存储类说明符已弃用且不兼容C++17 [-Wdeprecated-register] 注册 PyObjectobj, /对象 */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:553:5: 警告:“注册”存储类说明符已弃用且与 C++17 不兼容 [-Wdeprecated-register] register PyObject obj / Object */ ^~~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/ python2.7/unicodeobject.h:575:5: 警告: 'register' 存储类说明符已弃用并且与 C++17 [-Wdeprecated-register] register const wchar_t w 不兼容,/wchar_t 缓冲区 */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:593:5: 警告:“注册”存储类说明符已弃用且与 C++17 不兼容 [-Wdeprecated-register] register wchar_t w, / wchar_t buffer */ ^~~~~~~~~~ 包含在 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: 警告:'register' 存储类说明符已弃用并且与 C++17 [-Wdeprecated-register] register PyObject obj 不兼容,/字符串或 Unicode 对象 */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:174:5: warning: 'register' storage类说明符已弃用且与 C++17 [-Wdeprecated-register] register char **s, /* 指向缓冲区变量的指针 */ ^~~~~~~~~~ /System/Library/Frameworks/Python.framework 不兼容/Versions/2.7/include/python2.7/stringobject.h:175:5:警告:'register' 存储类说明符已弃用并且与 C++17 [-Wdeprecated-register] register Py_ssize_t len /不兼容[-W#warnings] #warning "使用已弃用的 NumPy API,通过 " \ ^ 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:警告:'register' 存储类说明符已弃用并且与 C++17 [-Wdeprecated-register] register PyObject 不兼容obj, /对象 */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:553:5: 警告:“注册”存储类说明符已弃用且与 C++17 不兼容 [-Wdeprecated-register] register PyObject obj / Object */ ^~~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/ python2.7/unicodeobject.h:575:5: 警告: 'register' 存储类说明符已弃用并且与 C++17 [-Wdeprecated-register] register const wchar_t w 不兼容,/wchar_t 缓冲区 */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:593:5: 警告:“注册”存储类说明符已弃用且与 C++17 不兼容 [-Wdeprecated-register] register wchar_t w, / wchar_t buffer */ ^~~~~~~~~~ 包含在 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: 警告:'register' 存储类说明符已弃用并且与 C++17 [-Wdeprecated-register] register PyObject obj 不兼容,/字符串或 Unicode 对象 */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:174:5: warning: 'register' storage类说明符已弃用且与 C++17 [-Wdeprecated-register] register char **s, /* 指向缓冲区变量的指针 */ ^~~~~~~~~~ /System/Library/Frameworks/Python.framework 不兼容/Versions/2.7/include/python2.7/stringobject.h:175:5:警告:'register' 存储类说明符已弃用并且与 C++17 [-Wdeprecated-register] register Py_ssize_t len /不兼容[-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(Dictionary, void, initNgrams, ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ src/private_access.h:55:38: 注意: 扩展自宏 'ALLOW_METHOD_ACCESS' 模板结构 rob ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ 产生5个错误。错误:命令“cc”失败,退出状态为 1 非类型模板参数不是指向成员常量 ALLOW_METHOD_ACCESS(Dictionary, void, initNgrams, ) 的指针;^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ src/private_access.h:55:38: 注意: 扩展自宏 'ALLOW_METHOD_ACCESS' 模板结构 rob ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ 产生5个错误。错误:命令“cc”失败,退出状态为 1 非类型模板参数不是指向成员常量 ALLOW_METHOD_ACCESS(Dictionary, void, initNgrams, ) 的指针;^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ src/private_access.h:55:38: 注意: 扩展自宏 'ALLOW_METHOD_ACCESS' 模板结构 rob ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ 产生5个错误。错误:命令“cc”失败,退出状态为 1 模板结构 rob ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~ 产生 5 个错误。错误:命令“cc”失败,退出状态为 1 模板结构 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/

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

标签: pythongccfasttext

解决方案


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

您可以改为使用:

pip install fastText

推荐阅读