在 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/coconet/Library/Python/2.7/lib/Python/site-packages中的cysignals(来自pyfasttext)(1.10.2)已满足要求:/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python中的numpy(来自pyfasttext)(1.8.0rc1)已满足要求:Cython>=0.28 in/Library/Python/2.7/site-packages(来自cysignals->pyfasttext)(0.29.13)安装收集的程序包:pyfasttext正在为pyfasttext运行setup.py安装。。。错误命令/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)(文件);code=f.read().replace('\r\n','\n');f.close();exec(compile(code,file,'exec'))"安装--记录/private/var/folders/gm/kpbf6gyx1dx_167zbp2gmdym0000gn/T/pip record Qtcina/install-record.txt--外部管理的单一版本--编译--用户--前缀=:正在运行安装正在运行生成运行build_ext正在生成"pyfasttext"扩展创建生成创建内部版本/临时版本macosx-10.14-电话-2.7创建build/temp.macosx-10.14-电话-2.7/src创建build/temp.macosx-10.14-tel-2.7/src/fastText创建build/temp.macosx-10.14-tel-2.7/src/fastText/srccc-DNDEBUG-g-fwrapv-Os-Wall-Wstrict原型-iqote-包括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/Exts/lib/Python/numpy/core/include-c src/pyfasttext.cpp-o build/temp.macosx-10.14-tel-2.7/src/pyfasttext.o-Wno符号比较-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 PyObjectobj,/Object*/^~~~~~~~~/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:553:5:警告:"register"存储类说明符已弃用,并且与C++17不兼容[-Wdeprecated-register]register PyObjectobj/Object*/^~~~~~~~~/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:5:5:警告:"register"存储类说明符已弃用,并且与C++17不兼容[-Wdeprecated-register]寄存器常量wchar_tw,/wchar_t缓冲区*/^~~~~~~~~/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:593:5:警告:"register"存储类说明符已弃用,并且与C++17不兼容[-Wdeprecated-register]注册wchar_tw,/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/stringoject.h:173:5:警告:"register"存储类说明符已弃用,并且与C++17不兼容[-Wdeprecated-register]注册PyObjectobj、/字符串或Unicode对象*/^~~~~~~~~/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringoject.h:174:5:警告:"register"存储类说明符已弃用,并且与C++17不兼容[-Wdeprecated-register]寄存器字符**s,/*指向缓冲区变量的指针*/^~~~~~~~~/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringoject.h:175:5:警告:"register"存储类说明符已弃用,并且与C++17不兼容[-Wdeprecated-register]将Py_ssize_tlen/指针注册到长度变量或NULL^~~~~~~~~在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/ndarayobject.h:17中包含的文件中:在/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/numpy/core/include/numpy/ndaraytypes.h:1760中包含的文件中:/System/Library/Frameworks/Python.framework/Versions/2.7/EExtras/lib/Python/numpy/core/include/numpy/npy_1,7_deprecated_api.h:15:2:warning:"使用不推荐使用的numpy api,通过"#defining npy_NO_deprecated_api npy_1_7_api_VERSION"[-W#warnings]禁用#警告"使用不推荐使用的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 PyObjectobj,/Object*/^~~~~~~~~/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:553:5:警告:"register"存储类说明符已弃用,并且与C++17不兼容[-Wdeprecated-register]register PyObjectobj/Object*/^~~~~~~~~/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:5:5:警告:"register"存储类说明符已弃用,并且与C++17不兼容[-Wdeprecated-register]寄存器常量wchar_tw,/wchar_t缓冲区*/^~~~~~~~~/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:593:5:警告:"register"存储类说明符已弃用,并且与C++17不兼容[-Wdeprecated-register]注册wchar_tw,/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/stringoject.h:173:5:警告:"register"存储类说明符已弃用,并且与C++17不兼容[-Wdeprecated-register]注册PyObjectobj、/字符串或Unicode对象*/^~~~~~~~~/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringoject.h:174:5:警告:"register"存储类说明符已弃用,并且与C++17不兼容[-Wdeprecated-register]寄存器字符**s,/*指向缓冲区变量的指针*/^~~~~~~~~/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringoject.h:175:5:警告:"register"存储类说明符已弃用,并且与C++17不兼容[-Wdeprecated-register]将Py_ssize_tlen/指针注册到长度变量或NULL^~~~~~~~~在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/ndarayobject.h:17中包含的文件中:在/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/numpy/core/include/numpy/ndaraytypes.h:1760中包含的文件中:/System/Library/Frameworks/Python.framework/Versions/2.7/EExtras/lib/Python/numpy/core/include/numpy/npy_1,7_deprecated_api.h:15:2:warning:"使用不推荐使用的numpy api,通过"#defining npy_NO_deprecated_api npy_1_7_api_VERSION"[-W#warnings]禁用#警告"使用不推荐使用的NumPy API,通过禁用它"\^生成8个警告。cc-DNDEBUG-g-fwrapv-Os-Wall-Wstrict原型-iqote-包括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/Python/2.7/Exts/lib/Python/numpy/core/include-c src/fasttext_access.cpp-o build/temp.macosx-10.14-intel-2.7/src/fasttext _access.o-Wno符号比较-std=c++0xsrc/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:错误:非类型模板参数不是指向成员常量的指针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

----------------------------------------
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('rn', '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

最新更新