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 ...
随机推荐
- KMP匹配算法
先来说一下回溯法匹配字符串: 对于主字符串有一个target_index,以target_index(不动)为起点,匹配字符串pattern的长度+target_index为终点,逐个进行比较,当发现 ...
- Spring实现文件上传
(别人的见解) 在使用springMVC进行系统实现时,springMVC默认的解析器里面是没有加入对文件上传的解析的,这可以方便我们实现自己的文件上传.但如果你想使用springMVC对文件上传的解 ...
- 获取本机内存使用信息、DataTable占用内存空间
相当于windows系统中的任务管理器,功能是通过系统的API实现的本机的监视,代码如下 using System;using System.Collections.Generic;using Sys ...
- [刘阳Java]_JVM工作流程_第4讲
程序员写好一段Java源程序-->编译-->字节码-->JVM-->硬件平台(操作系统)
- 联系人按照A~~~Z排列
// 01 创建可变字典,存储每一个key对应的数据列表 NSMutableDictionary *nationWithCodeDicList = [NSMutableDictionary dicti ...
- sandy bridge
SANDY BRIDGE SPANS GENERATIONS Intel Focuses on Graphics, Multimedia in New Processor Design By Li ...
- SharePoint中的ASHX
<%@ Assembly Name="namespace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=key" %&g ...
- DSP(2) -- 离散时间信号的序列运算
1.信号相加:这是一种对应的样本与样本之间的相加. 在Matlab中它可用算术运算符“+”实现,然后x1和x2的长度必须相等.如果序列不等,或者长度虽然相等但采样的位置不同,就不能用运算符“+”了.我 ...
- [转]centos6.6 rpm安装与管理
centos6.6 rpm安装与管理 原文地址:http://www.centoscn.com/CentOS/2015/0414/5182.html rpm包管理:安装.升级.卸载.查询.检验 安 ...
- ORACLE RAC 11G 更改 /etc/hosts文件
来自官方文档:()Can I change the public hostname in my Oracle Database 10g Cluster using Oracle Clusterware ...