An error occurred while installing MySQL-python: error: command 'gcc 'failed with exit status 1

Source: Internet
Author: User
Tags localhost mysql
_mysql.c:35:23: fatal error: my_config.h: No such file or directorycompilation terminated.error: command 'gcc' failed with exit status 1The complete error message is as below[root@localhost MySQL-python-1.2.2]# python setup.py buildrunning buildrunning build_pycreating buildcreating build/lib.linux-i686-2.6copying _mysql_exceptions.py -> build/lib.linux-i686-2.6creating build/lib.linux-i686-2.6/MySQLdbcopying MySQLdb/__init__.py -> build/lib.linux-i686-2.6/MySQLdbcopying MySQLdb/converters.py -> build/lib.linux-i686-2.6/MySQLdbcopying MySQLdb/connections.py -> build/lib.linux-i686-2.6/MySQLdbcopying MySQLdb/cursors.py -> build/lib.linux-i686-2.6/MySQLdbcopying MySQLdb/release.py -> build/lib.linux-i686-2.6/MySQLdbcopying MySQLdb/times.py -> build/lib.linux-i686-2.6/MySQLdbcreating build/lib.linux-i686-2.6/MySQLdb/constantscopying MySQLdb/constants/__init__.py -> build/lib.linux-i686-2.6/MySQLdb/constantscopying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.6/MySQLdb/constantscopying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-i686-2.6/MySQLdb/constantscopying MySQLdb/constants/ER.py -> build/lib.linux-i686-2.6/MySQLdb/constantscopying MySQLdb/constants/FLAG.py -> build/lib.linux-i686-2.6/MySQLdb/constantscopying MySQLdb/constants/REFRESH.py -> build/lib.linux-i686-2.6/MySQLdb/constantscopying MySQLdb/constants/CLIENT.py -> build/lib.linux-i686-2.6/MySQLdb/constantsrunning build_extbuilding '_mysql' extensioncreating build/temp.linux-i686-2.6gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/usr/include/mysql -I/usr/local/include/python2.6 -c _mysql.c -o build/temp.linux-i686-2.6/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX_mysql.c:35:23: fatal error: my_config.h: No such file or directorycompilation terminated.error: command 'gcc' failed with exit status 1[root@localhost MySQL-python-1.2.2]# python2.6 setup.py buildrunning buildrunning build_pycopying MySQLdb/release.py -> build/lib.linux-i686-2.6/MySQLdbrunning build_extbuilding '_mysql' extensiongcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/usr/include/mysql -I/usr/local/include/python2.6 -c _mysql.c -o build/temp.linux-i686-2.6/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX_mysql.c:35:23: fatal error: my_config.h: No such file or directorycompilation terminated.error: command 'gcc' failed with exit status 1

Error:

error: command 'gcc' failed with exit status 1

Cause:

Mysql-devel package Not Installed

Solution:

yum install mysql-devel

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.