centos6.6下安装MySQLdb时出现“error: command 'gcc' failed with exit status 1”
2015-02-07 17:33
751 查看
1. 问题描述
在MySQL-python-1.2.3源码包根目录下执行安装命令:# python setup.py install
出现以下信息:
error: command ‘gcc’ failed with exit status 1
2. 解决方法
在安装MySQLdb前安装以下依赖库:# yum install python-devel mysql-devel zlib-devel openssl-devel
安装完以上依赖库后, 再在MySQL-python-1.2.3源码包根目录下执行以下安装命令即可:
# python setup.py install
如下信息表示MySQLdb安装成功:
Installed /usr/local/lib/python2.7/site-packages/MySQL_python-1.2.3-py2.7-linux-x86_64.egg
Processing dependencies for MySQL-python==1.2.3
Finished processing dependencies for MySQL-python==1.2.3
接着还要重新编译安装Python-2.7.9, 在Python-2.7.9源码包根目录下执行以下命令:
# ./configure && make && make install
3. 检测模块MySQLdb是否可正常使用
在终端执行以下命令:# python Python 2.7.9 (default, Feb 7 2015, 17:28:17) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import MySQLdb >>>
没消息就是好消息!
OK, Enjoy it!!!
相关文章推荐
- 安装python模块时出现:error: Setup script exited with error: command 'gcc' failed with exit status 1
- CentOs安装Scrapy出现error: Setup script exited with error: command ‘gcc’ failed with exit status 1错误解决方案
- 安装MySQL-python时发生错误:error: command 'gcc' failed with exit status 1
- CentOs安装Scrapy出现error: Setup script exited with error: command ‘gcc’ failed with exit status 1错误解决方案
- CentOS7安装Murano-agent时的error:command 'gcc' failed with exit status 1
- CentOs安装Scrapy出现error: Setup script exited with error: command ‘gcc’ failed with exit status 1错误解决方案
- error: command 'gcc' failed with exit status 1
- 关于Python安装模块出现error: command 'gcc' failed with exit status 1错误的解决方法
- MAC安装python模块碰到“error: command 'cc' failed with exit status 1”解决办法
- error: Setup script exited with error: command 'gcc' failed with exit status 1
- centos7 安装mysql--python模块出现EnvironmentError: mysql_config not found和error: command 'gcc' failed with exit status 1
- command 'gcc' failed with exit status 1 error while installing scrapy
- pip install --upgrade pip,error: command 'gcc' failed with exit status 1
- error: command 'x86_64-linux-gnu-gcc' failed with exit status 1” in virtualenv
- error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
- centos 安装twisted 报错error: command 'gcc' failed with exit status 1
- 用安装python模块出现error: command 'gcc' failed with exit status 1 ,实际已经安装了gcc的,还是报错,然后发觉是failed不是not found,这说明这个错误个gcc没多大关系,应该是缺少某些功能模块,执行如下操作:
- [CentOS]安装MySQL-python,error: Setup script exited with error: command 'gcc' failed with exit status
- 安装python-MySQLdb 出现error: command 'gcc' failed with exit status 1的解决方法
- 解决Python扩展程序编译安装的error: command 'mt.exe' failed with exit status 31