在Python安装MySQLdb模块遇见的问题
来源:互联网 发布:sqlserver删除表数据 编辑:程序博客网 时间:2024/06/12 16:24
安装python2.7的MySQLdb模块时遇见如下问题:
[root@mycat-1 MySQL-python-1.2.3b1]# python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
running build_ext
building ‘_mysql’ extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong –param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong –param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,3,’beta’,1) -D__version__=1.2.3b1 -I/home/mycat/mysql_5717/include -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -fabi-version=2 -fno-omit-frame-pointer
_mysql.c:35:23: fatal error: my_config.h: No such file or directory
#include “my_config.h”
^
compilation terminated.
error: command ‘gcc’ failed with exit status 1
看网上说要安装mysql-devel:
yum install -y mysql-devel
但是安装之后还是报同样的错误
执行:which mysql_config
[root@mycat-1 MySQL-python-1.2.3b1]# which mysql_config/home/mycat/mysql_5717/bin/mysql_config
我感觉我发现问题了,可能是我yum安装mysql-devel、mysql的版本与PATH路径下的mysql_config版本有冲突
修改PATH中mysql_config路径,改外/usr/bin/mysql_conifg之后,再进行安装,成功了。
tips:还可以通过修改setup_posix.py中mysql_config.path直接改为/usr/local/mysql_config来解决版本冲突问题。
- 在Python安装MySQLdb模块遇见的问题
- Python的MYSQLdb模块安装
- Python的MySQLdb模块安装
- Python的MySQLdb模块安装
- Python的MySQLdb模块安装
- 在Win7中 安装Python的MySQLdb模块 出现问题的解决方法
- 在window平台下安装python的mysqldb模块
- Python安装MySQLDb模块的种种问题及解决
- Python安装MySQLDb模块的种种问题及解决
- python安装mysqldb模块遇到的问题和解决方法
- python 安装MySQLdb模块
- 安装MySQLdb模块-python
- MySQLdb python模块安装
- python安装mysqldb模块
- python 安装MySQLdb模块
- python安装mysqldb模块
- python 安装 MySQLdb模块
- Python 安装 MySQLdb 模块
- iOS 导航栏控制器UINavigationController 、UINavigationBar、UINavigationItem 之间的关系(二)
- dlopen()函数详解[转载]
- 20170519@HashTable
- spring配置定时器
- SugarCRM开发入门
- 在Python安装MySQLdb模块遇见的问题
- SQL基础知识
- Logistic回归
- 零基础学CNN
- 从零开始刷HDOJ(1)【HDOJ1000
- Java中如何将“字符串数组”转换成“字符串”
- Loadrunner自定义函数在脚本中的应用样例
- 敷铜的时候间距调整办法
- 安卓开发 一个比较炫的进度条