mac 10.9安装mysql-python

刚开始通过pip安装或者源码安装的时候,一直报错:

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了半天时间,终于解决了,记录一下。

原因出在最新的Xcode5.1,编译工具太新了。所以在pip时要添加一条信息:ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future。

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install mysql-python