zl程序教程

您现在的位置是:首页 >  其他

当前栏目

pip错误unused-command-line-argument-hard-error-in-future解决办法

错误pip Error in 解决办法 Command argument line
2023-06-13 09:15:27 时间

在我的MacAir上,用pip安装一些Python库时,偶尔就会遇到一些报错,关于“unused-command-line-argument-hard-error-in-future”,错误如下:

复制代码代码如下:

cc-fno-strict-aliasing-fno-common-dynamic-archx86_64-archi386-g-Os-pipe-fno-common-fno-strict-aliasing-fwrapv-mno-fused-madd-DENABLE_DTRACE-DMACOSX-DNDEBUG-Wall-Wstrict-prototypes-Wshorten-64-to-32-DNDEBUG-g-fwrapv-Os-Wall-Wstrict-prototypes-DENABLE_DTRACE-archx86_64-archi386-pipe-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7-cpsutil/_psutil_osx.c-obuild/temp.macosx-10.9-intel-2.7/psutil/_psutil_osx.o

clang:error:unknownargument:"-mno-fused-madd"[-Wunused-command-line-argument-hard-error-in-future]

clang:note:thiswillbeaharderror(cannotbedowngradedtoawarning)inthefuture

error:command"cc"failedwithexitstatus1

这样的错误,出现次数多了,每次都去google,不如自己记录一下吧。
原因是:TheAppleLLVMcompilerinXcode5.1treatsunrecognizedcommand-lineoptionsaserrors.ThisissuehasbeenseenwhenbuildingbothPythonnativeextensionsandRubyGems,wheresomeinvalidcompileroptionsarecurrentlyspecified.

解决方法:设置ARCHFLAGS参数,如下:

复制代码代码如下:

sudoARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-futurepipinstallpsutil