Error when using command pip to install Mysql-python
_mysql.c:2722:warning:implicit declaration of function ' Pymember_set '
_mysql.c:at Top level:
_mysql.c:2739:error:expected declaration specifiers or ' ... ' before ' pyobject '
_mysql.c:in function ' _mysql_resultobject_setattr ':
_mysql.c:2741:error: ' V ' undeclared (first use of this function)
_mysql.c:2742:error: ' Pyexc_attributeerror ' undeclared (first use of this function)
_mysql.c:at Top level:
_mysql.c:2760:error:expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' _mysql_connectionobject_type '
_mysql.c:2848:error:expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' _mysql_resultobject_type '
_mysql.c:2938:error:expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' _mysql_methods '
_mysql.c:3010:error:expected ' = ', ', ', '; ', ' asm ' or ' __attribute__ ' before ' * ' token
_mysql.c:3058:warning:return type defaults to ' int '
_mysql.c:in function ' Dl_export ':
_mysql.c:3058:error:expected declaration specifiers before ' Init_mysql '
_mysql.c:3166:error:expected ' {' at end of input
Error:command ' gcc ' failed with exit status 1
----------------------------------------
Command "/usr/bin/python-c" Import setuptools, tokenize;__file__= '/tmp/pip-build-1dnmxc/mysql-python/setup.py '; EXEC (Compile (getattr (tokenize, ' open ', open) (__file__). Read (). replace (' \ r \ n ', ' \ n '), __file__, ' exec ') "Install-- Record/tmp/pip-yhsnnu-record/install-record.txt--single-version-externally-managed--compile "failed with error Code 1 In/tmp/pip-build-1dnmxc/mysql-python
Workaround:
Install the following dependent libraries before installing MYSQLDB:
Yum install python-devel mysql-devel zlib-devel openssl-devel
After the library is loaded, execute pip install Mysql-python
This article is from "song" blog, please be sure to keep this source http://song1230.blog.51cto.com/5595296/1866209
FIX: CentOS installation python-mysql Error