问题描述
在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.egg
Processing dependencies for MySQL-python==1.2.5
Finished processing dependencies for MySQL-python==1.2.5
检测模块MySQLdb是否可正常使用
[root@gateway ~]# python |
没消息就是好消息! OK, Enjoy it!!!