安装 MySQL-python-1.2.4
首先报错:
IOError: Could not build the egg.
解决办法,安装:
distribute-0.7.3
之后,换了新错误:
<省略上面N多字报错>
……
_mysql.c:2273: 错误:‘_mysql_ConnectionObject’没有名为‘open’的成员
_mysql.c:2274: 错误:‘_mysql_ResultObject’没有名为‘use’的成员
_mysql.c:2279: 错误:‘r’未声明(在此函数内第一次使用)
_mysql.c:2279: 错误:‘_mysql_ResultObject’没有名为‘result’的成员
_mysql.c:2280: 错误:‘_mysql_ResultObject’没有名为‘result’的成员
_mysql.c: 在函数‘_mysql_ResultObject_dealloc’中:
_mysql.c:2288: 警告:隐式声明函数‘mysql_free_result’
_mysql.c:2288: 错误:‘_mysql_ResultObject’没有名为‘result’的成员
_mysql.c: 在文件层:
_mysql.c:2523: 错误:‘_mysql_ConnectionObject’没有名为‘open’的成员
_mysql.c:2530: 错误:‘_mysql_ConnectionObject’没有名为‘converter’的成员
_mysql.c:2537: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:2544: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:2551: 错误:‘_mysql_ConnectionObject’没有名为‘connection’的成员
_mysql.c:2614: 错误:‘_mysql_ResultObject’没有名为‘converter’的成员
_mysql.c:2614: 错误:初始值设定元素不是常量
_mysql.c:2614: 错误:(在‘_mysql_ResultObject_memberlist[0].offset’的初始化附近)
_mysql.c: 在函数‘_mysql_ConnectionObject_getattr’中:
_mysql.c:2638: 错误:‘_mysql_ConnectionObject’没有名为‘open’的成员
error: command 'gcc' failed with exit status 1
解决办法,安装mysql-devel:
#yum install mysql-devel
之后,mysq-python成功安装:
Installed /usr/local/lib/python2.7/site-packages/MySQL_python-1.2.4-py2.7-linux-x86_64.egg
Processing dependencies for MySQL-python==1.2.4
Finished processing dependencies for MySQL-python==1.2.4