python安装MySQLdb模块
以Ubuntu下安装为例:
下载地址:https://pypi.python.org/pypi/MySQL-python/
解压后直接进入解压目录运行安装命令。
python setup.py install
若成功,则能成功使用MySQLdb模块。
但是一般会出现以下问题:
1) ImportError: No module named setuptools
解决方案:
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz .6c11.tar.gz cd setuptools-.6c11 python setup.py build python setup.py install
以上命令最好用root权限执行,否则会出现错误。
2) EnvironmentError: mysql_config not found
解决方案:
apt-get install libmysqlclient-dev updatedb locate mysql_config
locate mysql_config 的作用是定位mysql_config文件位置,默认情况下为/usr/bin/mysql_config。
MySQLdb源码下找到setup_posix.py 文件, 将文件中mysql_config.path值改为:/usr/bin/mysql_config,然后就可以安装了
3) error: Setup script exited with error: command 'gcc' failed with exit status 1
解决方案:
apt-get install python-dev
python安装MySQLdb模块的更多相关文章
- windows(32位 64位)下python安装mysqldb模块
windows(32位 64位)下python安装mysqldb模块 www.111cn.net 编辑:mengchu9 来源:转载 本文章来给各位使用在此windows系统中的python来安装一个 ...
- 解决:python安装mysqldb模块报 EnvironmentError: mysql_config not found
最近学习python操作mysql需要安装mysqldb模块 出现EnvironmentError: mysql_config not found 经网上查看,需要安装mysql客户端开发库libmy ...
- Python 安装MySQLdb模块遇到报错及解决方案:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
一.问题 系统:win7 64位 在下载MySQL-python-1.2.5.zip,使用python setup.py install 安装时,出现以下报错: _mysql.c(42) : fata ...
- mac下python安装MySQLdb模块
参考:http://blog.csdn.net/yelyyely/article/details/41114449 1.调整到anaconda下的python 2.安装有关程序 brew instal ...
- Windows下python 安装Mysqldb模块
CMD执行 pip install mysql-python 报错如下: 1.如果报类似 Microsoft Visual C++ 9.0 is required < Unable to fin ...
- Mac OS X 下安装python的MySQLdb模块
参考资料: mac os x下python安装MySQLdb模块 http://www.codeif.com/post/1073/ MAC OSX使用Python安装模块有关问题 http:// ...
- Python下安装MySQLdb模块
----------------------[针对Windows下python 的MySQLdb模块安装]--------------------- 一.检查MySQLdb模块是否安装,可在DOS命令 ...
- python之mysqldb模块安装
之所以会写下这篇日志,是因为安装的过程有点虐心.目前这篇文章是针对windows操作系统上的mysqldb的安装.安装python的mysqldb模块,首先当然是找一些官方的网站去下载:https:/ ...
- python安装MySQLdb(即mysql-Python)模块的一些问题
1.超时问题 如果出现:ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out ...
随机推荐
- jquery验证
首先要引用js库 <script src="js/jquery-1.7.2.min.js"></script> jquery验证方式 function ch ...
- Access批量操作
鉴于C#要插5万条记录到Access很慢,在网上找了好久的资料,终于找到了比较有用的信息(转载自Bach)谢谢! 总结如下: 1.导出TXT: select * into [data.txt] in ...
- spring boot 学习笔记(二) 构建web支持jsp
一.必须将项目打包成war包 <packaging>war</packaging> 二.pom.xml加入依赖包 <dependency> <groupId& ...
- Android开发工具全面转向Android Studio(1)——准备开发环境
工欲善其事必先利其器,本文适合Android新手以及用过Eclipse而没用过Android Studio开发Android的老手,众所周知,谷歌是不会再维护和开发ADT了,旧的ADT已经是完全不能渲 ...
- AngularJs自定义指令详解(5) - link
在指令中操作DOM,我们需要link参数,这参数要求声明一个函数,称之为链接函数. 写法: link: function(scope, element, attrs) { // 在这里操作DOM} 如 ...
- ss
110000北京120000天津130000河北140000山西150000内蒙古210000辽宁220000吉林230000黑龙江310000上海320000江苏330000浙江340000安徽35 ...
- 2016/10/28 很久没更了 leetcode解题 3sum问题进阶版4sum
18. 4Sum Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c ...
- silverLight--绑定数据dataGrid
后台代码编写 ,为表格绑定数据: using System; using System.Collections.Generic; using System.Linq; using System.Net ...
- nginx下搭建 Yii框架
因为启用了rewrite,导致css,js,images等静态文件也定向到index.php 我不得不重定向静态文件的路径 仅供参考: server { listen 80; server_name ...
- MVC 3 IIS7.5 网站发布及IIS配置文件问题处理
1.环境配置 1) IIS7.5 2)VS2010 完整版 2.配置internet信息服务功能,直接上图,简洁明了. 3.打开VS2010 ,网站发布, 4.IIS网站设置 添加网站, 5-在浏览器 ...