安装MySQL-python报错error: command 'gcc' failed with exit status 1

[root@vmoffice-7 MySQL-python-1.2.3]# python setup.py install

function)

....

_mysql.c:133: error: ‘ER_SYNTAX_ERROR’ undeclared (first use in this function)

_mysql.c:380: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’

_mysql.c:382: warning: implicit declaration of function ‘mysql_store_result’

_mysql.c:382: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’

_mysql.c:383: 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’

error: command 'gcc' failed with exit status 1

解决:

yum install mysql-devel -y


libxml2 libxml2-dev libxslt* zlib gcc openssl 

你可能感兴趣的:(mysql,python,安装)