centos6.6下安装MySQLdb时出现“error: command 'gcc' failed with exit status 1”

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!!!

centos6.6下安装MySQLdb时出现“error: command 'gcc' failed with exit status 1”

时间: 2024-10-08 08:16:10

centos6.6下安装MySQLdb时出现“error: command 'gcc' failed with exit status 1”的相关文章

安装MySQL-python报错error: command 'gcc' failed with exit status 1

[[email protected] MySQL-python-1.2.3]# python setup.py install function) .... _mysql.c:133: error: 'ER_SYNTAX_ERROR' undeclared (first use in this function) _mysql.c:380: error: '_mysql_ConnectionObject' has no member named 'connection' _mysql.c:382

error: command 'gcc' failed with exit status 1

使用 pip install scrapy 安装 scrapy 时,提示error: command 'gcc' failed with exit status 1 解决方法: yum  -y  install  gcc   python-devel error: command 'gcc' failed with exit status 1

centos7 安装mysql--python模块出现EnvironmentError: mysql_config not found和error: command 'gcc' failed with exit status 1

要想使python可以操作mysql 就需要MySQL-python驱动,它是python 操作mysql必不可少的模块. 下载地址:https://pypi.python.org/pypi/MySQL-python/ 下载MySQL-python-1.2.5.zip 文件之后直接解压.进入MySQL-python-1.2.5目录: python setup.py install 报错: [[email protected] MySQL-python-1.2.4]# python setup.p

mysql_config not found和error: command 'gcc' failed with exit status 1

要想使python可以操作mysql 就需要MySQL-python驱动,它是python 操作mysql必不可少的模块. 下载地址:https://pypi.python.org/pypi/MySQL-python/ 下载MySQL-python-1.2.5.zip 文件之后直接解压.进入MySQL-python-1.2.5目录: python setup.py install 报错: [[email protected] MySQL-python-1.2.4]# python setup.p

【centos】 error: command 'gcc' failed with exit status 1

原文连接http://blog.csdn.net/fenglifeng1987/article/details/38057193 用安装Python模块出现error: command 'gcc' failed with exit status 1 ,明明装了gcc的,怎么会不行呢,然后发觉是failed不是not found,这说明这个错误个gcc没多大关系,应该是缺少某些功能模块,然后谷歌了一下,先后安装了python-devel,libffi-devel后还是不行,最后发觉要安装opens

【centos】 error: command 'gcc' failed with exit status 1 错误

转载自 :http://blog.csdn.net/fenglifeng1987/article/details/38057193 用安装Python模块出现error: command 'gcc' failed with exit status 1 ,明明装了gcc的,怎么会不行呢,然后发觉是failed不是not found,这说明这个错误个gcc没多大关系,应该是缺少某些功能模块,然后谷歌了一下,先后安装了python-devel,libffi-devel后还是不行,最后发觉要安装open

python安装模块的时候报错error: command 'gcc' failed with exit status 1

[情况] 在写Python代码的时候,需要用到psutil模块,需要安装. 但是在安装时,报错:error: command 'gcc' failed with exit status 1 [解决步骤] 按照经验,觉得应该是缺少了gcc模块, 所以操作 [ yum install -y gcc ] 安装完成后,再继续安装psutil还是报同样的错,发现报错不是  not found gcc,可能是某个功能模块缺失 发现需要安装多一些依赖的包:  [ yum install -y libffi-d

词云:解决pip install wordcloud安装过程中报错“error: command 'x86_64-linux-gnu-gcc' failed with exit status 1”问题

外部环境:ubuntu16.04, 64bits, 全局环境python2.7 在虚拟环境(python3.5)中执行 pip install wordcloud 时安装失败,报错: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for wordcloud Running setup.py

安装Python的psutil模块时报错:error: command 'gcc' failed with exit status 1

安装Python的psutil模块: tar zxvf psutil-2.0.0.tar.gz cd psutil-2.0.0 python setup.py install 报错: running install running bdist_egg ...... psutil/_psutil_linux.c:12:20: error: Python.h: No such file or directory In file included from psutil/_psutil_linux.c