MySQL-python,错误:命令'gcc-4.2'失败,退出状态为1 [英] MySQL-python, error: command 'gcc-4.2' failed with exit status 1

查看:166
本文介绍了MySQL-python,错误:命令'gcc-4.2'失败,退出状态为1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找解决方案,似乎有很多不同的解决方案,但似乎没有工作。



我' m使用MySQL-Python尝试使用python设置MySQL。但是,当我尝试运行时,

  sudo python setup.py build 

我收到以下错误:

 密码:
正在运行build
正在运行build_py
正在复制MySQLdb / release.py - > build / lib.macosx-10.6-intel-2.7 / MySQLdb
正在运行build_ext
正在建立'_mysql'扩展
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
从/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h包含的文件中:4,来自/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85的
,来自pymemcompat.h的
:10,来自_mysql的
.c:29:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25:error:stdarg.h:没有这样的文件或目录
在包含的文件中从_mysql.c:36:
/usr/local/mysql-5.5.21-osx10.6-x86/include/my_config。 h:329:1:warning:SIZEOF_SIZE_T重新定义
从/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:9包含的文件中,
从pymemcompat.h:10,从_mysql.c获得
:29:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:56:1:warning:这是以前定义的位置
从_mysql.c包含的文件中:36:
/usr/local/mysql-5.5.21-osx10.6-x86/include/my_config.h:422 :1:警告:HAVE_WCSCOLL重新定义
从/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:8包含的文件中,pymemcompat.h中的
:10,来自_mysql.c的
:29:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:887:1:警告:这是先前定义的位置
错误:命令'gcc-4.2'失败,退出状态1


解决方案

我拥有相同的p roblem。经过几个小时的挣扎之后,我使用了ActivePython( http://code.activestate.com / pypm / mysql-python / )成功安装MySQL-python。虽然它不能完全解决你的错误,但它解决了整体问题:)


I've been looking around for a solution to this, and there seem to be a lot of different solutions, but none seem to be working.

I'm using MySQL-Python to try to get MySQL set up with python. But, when I try to run

sudo python setup.py build

I get the following error:

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

解决方案

I had the same problem. After a few hours of struggling, I've used ActivePython (http://code.activestate.com/pypm/mysql-python/) successfully to install MySQL-python. Although it doesn't exactly solve your error, it solves the overall issue :)

这篇关于MySQL-python,错误:命令'gcc-4.2'失败,退出状态为1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆