今天在centos安装MySQL-python,结果报错,报错信息如下:
Running command /home/yunpeng.jiangyp/sys/python/bin/python -c "import setuptools;__file__='/home/admin/jyp/build/MySQL-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-MH5Aya-record/install-record.txt running install 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 -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/home/yunpeng.jiangyp/sys/python/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv _mysql.c:44:23: error: my_config.h: No such file or directory _mysql.c:46:19: error: mysql.h: No such file or directory _mysql.c:47:26: error: mysqld_error.h: No such file or directory _mysql.c:48:20: error: errmsg.h: No such file or directory _mysql.c:88: error: expected specifier-qualifier-list before ‘MYSQL’ _mysql.c:102: error: expected specifier-qualifier-list before ‘MYSQL_RES’
google找到答案(http://stackoverflow.com/questions/13044201/install-mysql-python-return-error-in-centos),需要先安装mysql-devel.x86_64,通过
sudo yum install mysql-devel.x86_64
再次安装成功
[yunpeng.jiangyp@v010105 ~]$ pip install MySQL-python Downloading/unpacking MySQL-python Running setup.py egg_info for package MySQL-python Installing collected packages: MySQL-python Running setup.py install for MySQL-python building '_mysql' extension gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/home/yunpeng.jiangyp/sys/python/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv gcc -pthread -shared build/temp.linux-x86_64-2.7/_mysql.o -L/usr/lib64/mysql -L/usr/lib64 -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread -lssl -lcrypto -o build/lib.linux-x86_64-2.7/_mysql.so Successfully installed MySQL-python Cleaning up...
相关推荐
MySQL-python-1.2.5.win-amd64-py2.7 亲测可用版 有效解决安装mysql-python时遇到的error: Unable to find vcvarsall.bat问题,哎,安装mingw什么的,都是浮云啊(搞了一个星期都没有成功啊)!还是这个有用!
有效解决安装mysql-python时遇到的error: Unable to find vcvarsall.bat问题,哎,安装mingw什么的,都是浮云啊(搞了一上午都没有成功啊)!还是这个有用!
32/64位windows,python2.7用的MySQL-python 解决安装MySQL-python出现的:Python version 2.7 required, which was not found in the registry
主要介绍了python安装mysql-python的方法,测试环境为ubuntu,较为详细的记录了安装mysql-python过程中遇到的问题与解决方法,具有一定参考借鉴价值,需要的朋友可以参考下
问题描述如下,报没有找到mysql_config环境变量 $ pip install mysql-python Collecting MySQL-python==1.2.5 (from -r requirement (line 16)) Downloading MySQL-python-1.2.5.zip (108kB) 100% |#############...
可解决:ImportError DLL load failed: %1 不是有效的 Win32 应用程序
解决Cannot open include file: 'config-win.h': No such file or directory。
python2.7.5安装mysqldb失败, my_config.h: No such file or directory. 解决办法:1)mysql版本太高,可降低版本 --此路一般不会考虑 2)注意下载的mysql-python的版本是否符和当前版本兼容 2)下载附件中的文件,...
安装完mysql-python后import加载模块提示以下错误, 代码如下: ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory 于是google之,总结一下解决方法: (1)在...
在安装Python2.7中MySQL库时,会遇到各种错误,包括VC驱动等问题,这里作者提供了完整的安装软件供读者安装,包括: 1.Python2.7 msi安装软件 2.get-pip.py文件,用于安装pip工具 3.VCForPython27.msi 4.MySQL-...
python使用mysql时,pip install mysql-python时会报错,_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No s uch file or directory,此时使用此版本可完美解决
NULL 博文链接:https://crazier9527.iteye.com/blog/390961
使用Python3连接mysql数据时的常规操作和一些遇到的问题解决
Windows下安装MySQL-python 下载地址:https://pypi.python.org/pypi/MySQL-python/1.2.5 安装到系统即可。 linux下安装MySQL-python以连接MySQL: 下载地址:https://pypi.python.org/pypi/MySQL-python/ 解压...
最近在使用Python开发系统,需连接mysql数据库,我用的是Python3连接MySQL8.0,其中老是报错以下问题: 网上给了各种各样的方法,大多是通过各种方式修改密码。 最简单的方法是更换了root密码的认证方式解决的,...
刚开始使用python,还不太熟练,遇到一个datetime数据类型的问题: 在mysql数据库中,有一个datetime类型的字段用于存储记录的日期时间值。python程序中有对应的一个datetime变量dt。 现在需要往mysql数据库中添加...
自定义mysql消息 关于 1、 mysqltools-python 是一个 专为 dba 服务的 python 工具包,主要的目的在于把一些锁定程序化,一方面可以提高劳动生产率,另一方面可以节约 dba 的时间。 2、 目前工具包中集成的工具列表 ...
Python 作为一种高效简洁的直译式语言非常适合我们用来解决日常工作的问题。而且它简单易学,初学者几个小时就可以基本入门。再加上Numpy 和matplotlib 这两个翅膀,Python 对数据分析的能力不逊于Matlab。Python 还...
\Program Files\MySQL\MySQL Connector C 6.0.2, 请手动复制到C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2,就可以解决上面报错问题(因为python2.7是32位,mysql官网已经不提供connector c的下载了)。