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
报错:
[root@centos7 MySQL-python-1.2.4]# python setup.py install
sh: mysql_config: command not found
Traceback (most recent call last):
File "setup.py", line 18, in <module>
metadata, options = get_config()
File "/root/MySQL-python-1.2.4/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/root/MySQL-python-1.2.4/setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
网上查了一下需安装mysql-devel
#yum -y install mysql-devel
安装成功后
# python setup.py install
安装成功。
[root@centos7 MySQL-python-1.2.5]# python
Python 2.7.5 (default, Jun 17 2014, 18:11:42)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
/usr/lib64/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /usr/lib64/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/_mysql.pyc, but /root/MySQL-python-1.2.5 is being added to sys.path
用安装Python模块出现error: command 'gcc' failed with exit status 1 ,明明装了gcc的,怎么会不行呢,然后发觉是failed不是not found,这说明这个错误个gcc没多大关系,应该是缺少某些功能模块,然后谷歌了一下,先后安装了python-devel,libffi-devel后还是不行,最后发觉要安装openssl-devel才行
可如下命令行安装:
yum install gcc libffi-devel python-devel openssl-devel
centos7 安装mysql--python模块出现EnvironmentError: mysql_config not found和error: command 'gcc' failed with exit status 1的更多相关文章
- mysql_config not found和error: command 'gcc' failed with exit status 1
要想使python可以操作mysql 就需要MySQL-python驱动,它是python 操作mysql必不可少的模块. 下载地址:https://pypi.python.org/pypi/MySQ ...
- python安装模块的时候报错error: command 'gcc' failed with exit status 1
[情况] 在写Python代码的时候,需要用到psutil模块,需要安装. 但是在安装时,报错:error: command 'gcc' failed with exit status 1 [解决步骤 ...
- pip安装模块时:error: command 'gcc' failed with exit status 1
用安装python模块出现error: command 'gcc' failed with exit status 1 问题: gcc编译缺少模块 解决方法: yum install gcc libf ...
- Centos4.3安装MySQL-python-1.2.3,出现error: command 'gcc' failed with exit status 1
在Linux Centos 4.3上安装MySQL-python-1.2.3的时候出现error: command 'gcc' failed with exit status 1, 具体原因是因为没有 ...
- python psutil 编译中断。 error: command 'gcc' failed with exit status 1
error info [root@chenbj psutil-2.0.0]# python setup.py install running install running bdist_egg run ...
- python模块安装报错 :error: command 'gcc' failed with exit status 1
参考:http://blog.csdn.net/fenglifeng1987/article/details/38057193 解决方法 yum install gcc libffi-devel py ...
- centos7.2安装paramiko报error: command 'gcc' failed with exit status 1的解决办法
安装依赖 yum install kernel-devel libxslt-devel libffi-devel python-devel mysql-devel zlib-devel openssl ...
- Python 安装出错:Setup script exited with error: command 'gcc' failed with exit status 1
退出当前环境: logout (再重新登录进去) yum install python-devel -yyum install libevent-devel -y 把环境更新下yum instal ...
- CentOs安装Scrapy出现error: Setup script exited with error: command ‘gcc’ failed with exit status 1错误解决方案
按照 http://www.1207.me/archives/209.html 的教程安装Scrapy出现了上述错误,但是本身机器已经有了gcc,所以应该是安装包的问题 百度又看到了同博客里的解决方案 ...
随机推荐
- C# 3.0 / C# 3.5 隐式(推断)类型 var
概述 你可能对隐式类型(或隐式推断类型)这个名称比较陌生,但是 var 这个关键字应该很熟悉. 在 C# 中使用 var 声明一个对象时编译器会自动根据赋值语句推断这个局部变量的类型. 赋值以后,这个 ...
- 数据库恢复(database restore)之兵不血刃——半小时恢复客户数据库
昨天,一个客户打打来电话,说他们的数据库坏了,不能用了,需要我帮助恢复下,这马上要放假了,居然出了这事儿,自己也不太喜欢恢复数据库这类,尤其是他们的数据库是个win上的库,但心里很清楚,客户比咱着急, ...
- dubbo 框架和 tomcat 的比较
接触 dubbo 有一段时间,特别想拿 dubbo 和 tomcat 比较一番. tomcat 是 web 服务器,提供 http 服务,当 tomcat 收到浏览器发送的 http 请求时,根据 u ...
- textarea标签内的文字无缘故居中解决原因
<textarea> 内容内容 </textarea> 浏览器会解析为 <textarea><br> 内容内容</textarea> ...
- windows安装weblogic并集成到eclipse
1.下载 java是跨平台的,所以windows下载和linux一样的jar文件安装就行,当然也可以使用windows安装程序来安装. (weblogic下载不需要购买--oracle产品都是补丁和技 ...
- 在用mybatis向MySQL数据库中插入时间时报错:Incorrect datetime value: '' for column '' at row 1
问题说明:使用的MySQL是5.1.37版本,用的mysql-connector-java-5.0.4.jar版本,在java文件中定义的字段是Date类型,MySQL中定义的字段类型是datetim ...
- js string对象方法
substr(start,length) substring(start,end) 返回子串,原字符串不改变.
- 转 /etc/ld.so.conf.d/目录下文件的作用
在了解/etc/ld.so.conf.d/目录下文件的作用之前,先介绍下程序运行是加载动态库的几种方法:第一种,通过ldconfig命令 ldconfig命令的用途, 主要是在默认搜寻目录(/l ...
- POJ 1458 最长公共子序列(dp)
POJ 1458 最长公共子序列 题目大意:给出两个字符串,求出这样的一 个最长的公共子序列的长度:子序列 中的每个字符都能在两个原串中找到, 而且每个字符的先后顺序和原串中的 先后顺序一致. Sam ...
- vs2017 Mariadb/mysql之旅
记录vs2017使用 ef6+mysql的开发 填坑之旅.我的环境 vm+centos7+ docker-ce+mariadb+vs2017 总的原则是MySql.Data.Entity 要和 mys ...