MySQL-python,错误:command';gcc-4.2';失败,退出状态为1

MySQL-python,错误:command';gcc-4.2';失败,退出状态为1,python,gcc,mysql-python,Python,Gcc,Mysql Python,我一直在寻找解决这个问题的方法,似乎有很多不同的方法,但似乎没有一种有效 我正在使用MySQL-Python尝试用Python设置MySQL。但是,当我试着跑的时候 sudo python setup.py build 我得到以下错误: Password: running build running build_py copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb running build_ex

我一直在寻找解决这个问题的方法,似乎有很多不同的方法,但似乎没有一种有效

我正在使用MySQL-Python尝试用Python设置MySQL。但是,当我试着跑的时候

sudo python setup.py build
我得到以下错误:

Password:
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
running build_ext
building '_mysql' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/local/mysql-5.5.21-osx10.6-x86/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.6-intel-2.7/_mysql.o -Os -g -fno-common -fno-strict-aliasing -arch i386
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4,
             from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85,
             from pymemcompat.h:10,
             from _mysql.c:29:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
In file included from _mysql.c:36:
/usr/local/mysql-5.5.21-osx10.6-x86/include/my_config.h:329:1: warning: "SIZEOF_SIZE_T" redefined
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:9,
             from pymemcompat.h:10,
             from _mysql.c:29:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:56:1: warning: this is the location of the previous definition
In file included from _mysql.c:36:
/usr/local/mysql-5.5.21-osx10.6-x86/include/my_config.h:422:1: warning: "HAVE_WCSCOLL" redefined
In file included from     /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:8,
             from pymemcompat.h:10,
             from _mysql.c:29:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:887:1: warning: this is the location of the previous definition
error: command 'gcc-4.2' failed with exit status 1

我也有同样的问题。经过几个小时的努力,我已经成功地使用ActivePython()安装了MySQL-python。虽然它并不能完全解决您的错误,但它解决了整个问题:)

“有很多不同的解决方案,但似乎都不起作用”。请具体说明。你试过什么?发生了什么?同样的错误也发生了,但我甚至没有找到他们所说的台词,而且这个错误似乎并不完全正确same@S.Lott所有其他解决方案似乎都是这两种方案的变体。是的,我只是暂时使用了SQLite,但我想这只是你不得不尝试安装不同东西的时候之一。