166 words
1 minute
Centos6下安装MySQL-python时出现“error: command 'gcc' failed with exit status 1”
问题描述
在MySQL-python-1.2.5源码包根目录下执行安装命令:
# python setup.py install出现以下信息:
error: command ‘gcc’ failed with exit status 1解决方法
在安装MySQLdb前安装以下依赖库:
# yum install python-devel mysql-devel zlib-devel openssl-devel安装完以上依赖库后, 再在MySQL-python-1.2.3源码包根目录下执行以下安装命令即可:
# python setup.py install如下信息表示MySQLdb安装成功:
Installed /usr/lib64/python2.6/site-packages/MySQL_python-1.2.5-py2.6-linux-x86_64.eggProcessing dependencies for MySQL-python==1.2.5Finished processing dependencies for MySQL-python==1.2.5检测模块MySQLdb是否可正常使用
[root@gateway ~]# pythonPython 2.6.6 (r266:84292, Aug 18 2016, 15:13:37)[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import MySQLdb>>>没消息就是好消息! OK, Enjoy it!!!
Centos6下安装MySQL-python时出现“error: command 'gcc' failed with exit status 1”
https://w23ta0.vercel.app/posts/fix-mysql-python-install-error-gcc-failed-on-centos6/