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


Posted in Python onJune 01, 2014

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

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c psutil/_psutil_osx.c -o build/temp.macosx-10.9-intel-2.7/psutil/_psutil_osx.o
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1

这样的错误,出现次数多了,每次都去google,不如自己记录一下吧。
原因是:The Apple LLVM compiler in Xcode 5.1 treats unrecognized command-line options as errors. This issue has been seen when building both Python native extensions and Ruby Gems, where some invalid compiler options are currently specified.

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

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install psutil
Python 相关文章推荐
python调用机器喇叭发出蜂鸣声(Beep)的方法
Mar 23 Python
python集合类型用法分析
Apr 08 Python
Python 实现简单的shell sed替换功能(实例讲解)
Sep 29 Python
linux下安装python3和对应的pip环境教程详解
Jul 01 Python
django获取from表单multiple-select的value和id的方法
Jul 19 Python
Python3.7 pyodbc完美配置访问access数据库
Oct 03 Python
python解析多层json操作示例
Dec 30 Python
PyTorch使用cpu加载模型运算方式
Jan 13 Python
django xadmin action兼容自定义model权限教程
Mar 30 Python
Python如何根据时间序列数据作图
May 12 Python
python 将html转换为pdf的几种方法
Dec 29 Python
详解PyTorch模型保存与加载
Apr 28 Python
2款Python内存检测工具介绍和使用方法
Jun 01 #Python
使用Python的Supervisor进行进程监控以及自动启动
May 29 #Python
python应用程序在windows下不出现cmd窗口的办法
May 29 #Python
python正则表达式re模块详细介绍
May 29 #Python
在python中的socket模块使用代理实例
May 29 #Python
python中stdout输出不缓存的设置方法
May 29 #Python
python两种遍历字典(dict)的方法比较
May 29 #Python
You might like
各种战术和打法的原创者
2020/03/04 星际争霸
用Socket发送电子邮件(利用需要验证的SMTP服务器)
2006/10/09 PHP
[原创]PHP简单开启curl的方法(测试可行)
2016/01/11 PHP
PHP+AjaxForm异步带进度条上传文件实例代码
2017/08/14 PHP
基于jQuery的ajax功能实现web service的json转化
2009/08/29 Javascript
Express作者TJ告别Node.js奔向Go
2014/07/14 Javascript
在JavaScript中重写jQuery对象的方法实例教程
2014/08/25 Javascript
Jquery判断form表单数据是否变化
2016/03/30 Javascript
Bootstrap每天必学之警告框插件
2016/04/26 Javascript
bootstrap模态框消失问题的解决方法
2016/12/02 Javascript
JS获取鼠标位置距浏览器窗口距离的方法示例
2017/04/11 Javascript
Vue如何从1.0迁移到2.0
2017/10/19 Javascript
解决easyui日期时间框ie的兼容的问题
2018/03/01 Javascript
vue中使用gojs/jointjs的示例代码
2018/08/24 Javascript
解决JQuery的ajax函数执行失败alert函数弹框一闪而过问题
2019/04/10 jQuery
vue props对象validator自定义函数实例
2019/11/13 Javascript
jquery实现上传文件进度条
2020/03/26 jQuery
jQuery实现全选按钮
2021/01/01 jQuery
用pywin32实现windows模拟鼠标及键盘动作
2014/04/22 Python
MySQLdb ImportError: libmysqlclient.so.18解决方法
2014/08/21 Python
Python随机生成数据后插入到PostgreSQL
2016/07/28 Python
python读取与写入csv格式文件的示例代码
2017/12/16 Python
opencv调整图像亮度对比度的示例代码
2019/09/27 Python
关于numpy中eye和identity的区别详解
2019/11/29 Python
如何使用Python发送HTML格式的邮件
2020/02/11 Python
Pandas —— resample()重采样和asfreq()频度转换方式
2020/02/26 Python
收集的7个CSS3代码生成工具
2010/04/17 HTML / CSS
顶级宝石首饰网络零售商:Angara
2016/10/25 全球购物
车辆维修工自我评价怎么写
2013/09/20 职场文书
高中毕业生自我鉴定
2013/11/03 职场文书
争论的故事教学反思
2014/02/06 职场文书
竞选村长演讲稿
2014/04/28 职场文书
考博专家推荐信
2014/05/10 职场文书
2014年检验员工作总结
2014/11/19 职场文书
2014年城管个人工作总结
2014/12/08 职场文书
python百行代码实现汉服圈图片爬取
2021/11/23 Python