我试图从源代码安装mysql-python,并且编译器似乎一直卖到这个错误为止:

>running build_ext
>
>building '_mysql' extension
>
>ccreating build/temp.macosx-10.7-intel-2.7
>llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -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 -pipe ->Dversion_info=(1,2,4,'beta',4) -D__version__=1.2.4b4 -I/usr/local/mysql/include -
>I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -
>o build/temp.macosx-10.7-intel-2.7/_mysql.o -Wno-null-conversion -Os -g -fno-strict-aliasing ->arch i386
>
>cc1: error: unrecognized command line option "-Wno-null-conversion"
>
>error: command 'llvm-gcc-4.2' failed with exit status 1

最佳答案

首先,看起来您正在尝试安装Beta,除非您正在寻找它,否则,我强烈建议您使用pip安装

您似乎遇到的错误是必须处理gcc而不理解命令行选项之一。

这是您要安装的库的最新版本的链接

https://pypi.python.org/pypi/MySQL-python/1.2.4

我会尝试的。

或从安装程序中删除无效的选项。

09-04 11:06
查看更多