简体   繁体   English

MySQLdb Python连接器构建和安装命令'gcc-4.2'失败,退出状态为255

[英]MySQLdb Python connector building and installation command 'gcc-4.2' failed with exit status 255

I'm running Mac Lion. 我正在运行Mac Lion。 I've installed python 2.7.2 and django 1.3.1. 我已经安装了python 2.7.2和django 1.3.1。 Both of them work fine. 他们两个都工作正常。 To make python work with mysql, I have to install MySQL-python-1.2.3 -- but I can't get the build to work. 为了使python与mysql一起使用,我必须安装MySQL-python-1.2.3 -但是我无法使构建正常工作。 For the MySQL, I have XAMPP and I've set XAMPP's bin to the system environment path for the mysql_config the building needs. 对于MySQL,我有XAMPP,并将XAMPP的bin设置为建筑物所需的mysql_config的系统环境路径。

SOFXGF-AIR:MySQL-python-1.2.3 Sofia$ python setup.py buildrunning 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/Applications/XAMPP/xamppfiles/include/mysql -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 -mmacosx-version-min=10.4 -arch i386 -arch ppc -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
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
_mysql.c:36:23: error: my_config.h: No such file or directory
_mysql.c:38:19: error: mysql.h: No such file or directory
_mysql.c:39:26: error: mysqld_error.h: No such file or directory
_mysql.c:40:20: error: errmsg.h: No such file or directory
_mysql.c:76: error: expected specifier-qualifier-list before ‘MYSQL’
_mysql.c:90: error: expected specifier-qualifier-list before ‘MYSQL_RES’
_mysql.c: In function ‘_mysql_Exception’:
_mysql.c:120: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:123: error: ‘CR_MAX_ERROR’ undeclared (first use in this function)
_mysql.c:123: error: (Each undeclared identifier is reported only once
_mysql.c:123: error: for each function it appears in.)
_mysql.c:131: error: ‘CR_COMMANDS_OUT_OF_SYNC’ undeclared (first use in this function)
_mysql.c:132: error: ‘ER_DB_CREATE_EXISTS’ undeclared (first use in this function)
_mysql.c:133: error: ‘ER_SYNTAX_ERROR’ undeclared (first use in this function)
_mysql.c:134: error: ‘ER_PARSE_ERROR’ undeclared (first use in this function)
_mysql.c:135: error: ‘ER_NO_SUCH_TABLE’ undeclared (first use in this function)
_mysql.c:136: error: ‘ER_WRONG_DB_NAME’ undeclared (first use in this function)
_mysql.c:137: error: ‘ER_WRONG_TABLE_NAME’ undeclared (first use in this function)
_mysql.c:138: error: ‘ER_FIELD_SPECIFIED_TWICE’ undeclared (first use in this function)
_mysql.c:139: error: ‘ER_INVALID_GROUP_FUNC_USE’ undeclared (first use in this function)
_mysql.c:140: error: ‘ER_UNSUPPORTED_EXTENSION’ undeclared (first use in this function)
_mysql.c:141: error: ‘ER_TABLE_MUST_HAVE_COLUMNS’ undeclared (first use in this function)
_mysql.c:170: error: ‘ER_DUP_ENTRY’ undeclared (first use in this function)
_mysql.c:213: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:213: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ResultObject_Initialize’:
_mysql.c:363: error: ‘MYSQL_RES’ undeclared (first use in this function)
_mysql.c:363: error: ‘result’ undeclared (first use in this function)
_mysql.c:368: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:368: error: ‘fields’ undeclared (first use in this function)
_mysql.c:377: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:380: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:382: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:383: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:386: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:390: error: ‘_mysql_ResultObject’ has no member named ‘nfields’
_mysql.c:391: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:438: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ResultObject_traverse’:
_mysql.c:450: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:451: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ResultObject_clear’:
_mysql.c:462: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:462: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:462: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:462: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:463: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ConnectionObject_Initialize’:
_mysql.c:475: error: ‘MYSQL’ undeclared (first use in this function)
_mysql.c:475: error: ‘conn’ undeclared (first use in this function)
_mysql.c:500: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:501: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:537: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:540: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:540: error: ‘MYSQL_OPT_CONNECT_TIMEOUT’ undeclared (first use in this function)
_mysql.c:544: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:544: error: ‘MYSQL_OPT_COMPRESS’ undeclared (first use in this function)
_mysql.c:545: error: ‘CLIENT_COMPRESS’ undeclared (first use in this function)
_mysql.c:548: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:548: error: ‘MYSQL_OPT_NAMED_PIPE’ undeclared (first use in this function)
_mysql.c:550: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:550: error: ‘MYSQL_INIT_COMMAND’ undeclared (first use in this function)
_mysql.c:552: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:552: error: ‘MYSQL_READ_DEFAULT_FILE’ undeclared (first use in this function)
_mysql.c:554: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:554: error: ‘MYSQL_READ_DEFAULT_GROUP’ undeclared (first use in this function)
_mysql.c:557: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:557: error: ‘MYSQL_OPT_LOCAL_INFILE’ undeclared (first use in this function)
_mysql.c:565: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:583: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:591: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c: In function ‘_mysql_ConnectionObject_traverse’:
_mysql.c:672: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:673: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ConnectionObject_clear’:
_mysql.c:681: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:681: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:681: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:681: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:682: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ConnectionObject_close’:
_mysql.c:697: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:699: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:701: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c: In function ‘_mysql_ConnectionObject_affected_rows’:
_mysql.c:723: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:724: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_dump_debug_info’:
_mysql.c:758: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:760: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_autocommit’:
_mysql.c:784: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_commit’:
_mysql.c:807: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_rollback’:
_mysql.c:829: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_errno’:
_mysql.c:941: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:942: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_error’:
_mysql.c:957: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:958: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:958: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_escape’:
_mysql.c:1089: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ResultObject_describe’:
_mysql.c:1169: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:1169: error: ‘fields’ undeclared (first use in this function)
_mysql.c:1172: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1173: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1174: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ResultObject_field_flags’:
_mysql.c:1205: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:1205: error: ‘fields’ undeclared (first use in this function)
_mysql.c:1208: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1209: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1210: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: At top level:
_mysql.c:1251: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c: In function ‘_mysql_row_to_tuple’:
_mysql.c:1257: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1259: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1259: warning: assignment makes pointer from integer without a cast
_mysql.c:1262: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:1263: error: ‘row’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1276: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c: In function ‘_mysql_row_to_dict’:
_mysql.c:1281: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:1281: error: ‘fields’ undeclared (first use in this function)
_mysql.c:1283: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1285: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1285: warning: assignment makes pointer from integer without a cast
_mysql.c:1286: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1289: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:1290: error: ‘row’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1315: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c: In function ‘_mysql_row_to_dict_old’:
_mysql.c:1320: error: ‘MYSQL_FIELD’ undeclared (first use in this function)
_mysql.c:1320: error: ‘fields’ undeclared (first use in this function)
_mysql.c:1322: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1324: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1324: warning: assignment makes pointer from integer without a cast
_mysql.c:1325: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1328: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:1329: error: ‘row’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:1351: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c: In function ‘_mysql__fetch_row’:
_mysql.c:1362: error: ‘MYSQL_ROW’ undeclared (first use in this function)
_mysql.c:1362: error: expected ‘;’ before ‘row’
_mysql.c:1366: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:1367: error: ‘row’ undeclared (first use in this function)
_mysql.c:1367: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1370: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1373: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1381: error: too many arguments to function ‘convert_row’
_mysql.c: In function ‘_mysql_ResultObject_fetch_row’:
_mysql.c:1405: error: expected declaration specifiers or ‘...’ before ‘MYSQL_ROW’
_mysql.c:1420: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1432: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:1446: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ConnectionObject_character_set_name’:
_mysql.c:1513: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c: In function ‘_mysql_get_client_info’:
_mysql.c:1604: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ConnectionObject_get_host_info’:
_mysql.c:1618: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1619: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1619: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ConnectionObject_get_proto_info’:
_mysql.c:1633: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1634: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_get_server_info’:
_mysql.c:1648: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1649: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1649: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ConnectionObject_info’:
_mysql.c:1665: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1666: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1666: warning: assignment makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ConnectionObject_insert_id’:
_mysql.c:1698: error: ‘my_ulonglong’ undeclared (first use in this function)
_mysql.c:1698: error: expected ‘;’ before ‘r’
_mysql.c:1700: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1702: error: ‘r’ undeclared (first use in this function)
_mysql.c:1702: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_kill’:
_mysql.c:1719: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1721: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_field_count’:
_mysql.c:1740: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1742: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ResultObject_num_fields’:
_mysql.c:1757: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1758: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ResultObject_num_rows’:
_mysql.c:1773: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1774: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ConnectionObject_ping’:
_mysql.c:1803: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1804: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1806: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_query’:
_mysql.c:1827: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1829: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_select_db’:
_mysql.c:1857: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1859: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_shutdown’:
_mysql.c:1878: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1880: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_stat’:
_mysql.c:1905: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1907: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1907: warning: assignment makes pointer from integer without a cast
_mysql.c: In function ‘_mysql_ConnectionObject_store_result’:
_mysql.c:1928: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1929: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:1938: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ConnectionObject_thread_id’:
_mysql.c:1967: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1969: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ConnectionObject_use_result’:
_mysql.c:1989: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:1990: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:1999: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ConnectionObject_dealloc’:
_mysql.c:2017: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c: In function ‘_mysql_ConnectionObject_repr’:
_mysql.c:2029: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2031: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c: In function ‘_mysql_ResultObject_data_seek’:
_mysql.c:2048: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2049: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ResultObject_row_seek’:
_mysql.c:2062: error: ‘MYSQL_ROW_OFFSET’ undeclared (first use in this function)
_mysql.c:2062: error: expected ‘;’ before ‘r’
_mysql.c:2064: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2065: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:2070: error: ‘r’ undeclared (first use in this function)
_mysql.c:2070: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:2071: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ResultObject_row_tell’:
_mysql.c:2083: error: ‘MYSQL_ROW_OFFSET’ undeclared (first use in this function)
_mysql.c:2083: error: expected ‘;’ before ‘r’
_mysql.c:2085: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2086: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:2091: error: ‘r’ undeclared (first use in this function)
_mysql.c:2091: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:2092: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: In function ‘_mysql_ResultObject_dealloc’:
_mysql.c:2100: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c: At top level:
_mysql.c:2331: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2338: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:2345: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:2352: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:2359: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:2422: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:2422: error: initializer element is not constant
_mysql.c:2422: error: (near initialization for ‘_mysql_ResultObject_memberlist[0].offset’)
_mysql.c: In function ‘_mysql_ConnectionObject_getattr’:
_mysql.c:2444: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
gcc-4.2: error trying to exec '/usr/bin/powerpc-apple-darwin11-gcc-4.2.1': execvp: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/jr/zhr6zd952zv84lqwbhm05k4m0000gn/T//ccthbt7t.out
error: command 'gcc-4.2' failed with exit status 255

I'm not sure if this is right but I also tried sudo env ARCHFLAGS='-arch x86_64' python setup.py build as I noticed that -arch ppc is being mentioned in the error message. 我不确定这是否正确,但是我也尝试了sudo env ARCHFLAGS='-arch x86_64' python setup.py build因为我注意到错误消息中提到了-arch ppc However, I'm still getting the same errors. 但是,我仍然遇到相同的错误。 Also there might be something about No such file or directory errors? 也可能有关于“ No such file or directory错误”的问题? I have XCode 4 installed. 我已经安装了XCode 4。

You need the mysql-devel package installed as well. 您还需要安装mysql-devel软件包。 Always watch for the .h extension files. 始终注意.h扩展文件。 If you see errors because of them it means the developer package isn't installed and what you ware compiling requires it. 如果您发现由于错误而导致的错误,则意味着未安装开发人员软件包,而您所编译的内容则需要该软件包。

Since you are on a Mac, you'll need the uncompiled source files for MySQL so that it can access those header files. 由于您使用的是Mac,因此您需要MySQL的未编译源文件,以便它可以访问那些头文件。 You can grab it here: http://dev.mysql.com/downloads/mirror.php?id=405008 您可以在这里获取它: http : //dev.mysql.com/downloads/mirror.php?id=405008

You will likely have to tell the build command where those files are located. 您可能必须告诉build命令这些文件位于何处。 Try python ./setup.py --help 试试python ./setup.py --help

Make sure that you have mysql installed: 确保您已安装mysql:

brew install mysql

If you have it (eg like MAMP), make sure that mysql_config is runnable (see: site.cfg). 如果有(例如MAMP),请确保mysql_config是可运行的(请参阅:site.cfg)。

Otherwise you can try to install mysql-python in other ways like: 否则,您可以尝试以其他方式安装mysql-python:

using ActivePython : 使用ActivePython

easy_install mysql-connector-python

or using MySQL Python Connector: 或使用MySQL Python连接器:

pypm install mysql-python

Or you can download MySQL Python Connector from here: http://dev.mysql.com/downloads/connector/python/ 或者,您可以从此处下载MySQL Python Connector: http : //dev.mysql.com/downloads/connector/python/

See also the documentation: http://dev.mysql.com/doc/refman/5.5/en/connector-python.html 另请参见文档: http : //dev.mysql.com/doc/refman/5.5/en/connector-python.html


Related: 有关:

"Cannot open include file: 'config-win.h': No such file or directory" while installing mysql-python 在安装mysql-python时“无法打开包含文件:'config-win.h':没有这样的文件或目录”

为了我:

yum install MySQL-python

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM