Windows+Python2.7下安装MySQLdb驱动
2014-06-18 09:55
204 查看
下载与安装
Python中使用MySQL需要安装MySQLdb驱动,可以从CSDN下载内下,
MySQL-python-1.2.4.win32-py2.7.exe
目前支持最高Python版本号2.7:
Windows下可以安装二进制版本的MySQLdb。
目前版本: MySQL-python-1.2.4.win32-py2.7.exe
下载地址:http://download.csdn.net/detail/jindou910101/6240599
保证好用。
常见问题:
1.ImportError: DLL load failed: 找不到指定的模块。
C:\Python26>python
Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import MySQLdb
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “C:\Python26\Lib\site-packages\MySQLdb\__init__.py”, line 19, in <module>
import _mysql
ImportError: DLL load failed: 找不到指定的模块。
解决办法:我参考了 http://sourceforge.net/projects/mysql-python/forums/forum/70460/topic/2316047
需要下载libmmd.dll和libguide40.dll两个dll文件并复制到Python安装目录的Lib\site-packages下,链接在下面,你也可以谷歌一下:
libguide40.dll.zip
libmmd.dll.zip
2.被弃用的set模块,这个只是个警告,也可以不改
C:\Python26>python
Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import MySQLdb
C:\Python26\lib\site-packages\MySQLdb\__init__.py:34: DeprecationWarning: the sets module is deprecated
from sets import ImmutableSet
解决办法:要是每回都跳出来,那多不爽啊,set模块现在已经是内建的数据类型了,ImmutableSet现在成了frozenset。因此需要改成:
1) file “__init__”:
from sets import ImmutableSet
class DBAPISet(ImmutableSet):
改为
class DBAPISet(frozenset) :
2) file “converters.py”, 删除:
from sets import BaseSet, Set
3) file “converters.py”, 将 “Set”改为“set” (IMPORTANT: 共有两处):
line 45: return set([ i for i in s.split(',') if i ])
line 129: set: Set2Str,
最新消息,你可以去这里下载没有任何问题的MySQLdb,国外的大牛所作:
Python中使用MySQL需要安装MySQLdb驱动,可以从CSDN下载内下,
MySQL-python-1.2.4.win32-py2.7.exe
目前支持最高Python版本号2.7:
Windows下可以安装二进制版本的MySQLdb。
目前版本: MySQL-python-1.2.4.win32-py2.7.exe
下载地址:http://download.csdn.net/detail/jindou910101/6240599
保证好用。
常见问题:
1.ImportError: DLL load failed: 找不到指定的模块。
C:\Python26>python
Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import MySQLdb
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “C:\Python26\Lib\site-packages\MySQLdb\__init__.py”, line 19, in <module>
import _mysql
ImportError: DLL load failed: 找不到指定的模块。
解决办法:我参考了 http://sourceforge.net/projects/mysql-python/forums/forum/70460/topic/2316047
需要下载libmmd.dll和libguide40.dll两个dll文件并复制到Python安装目录的Lib\site-packages下,链接在下面,你也可以谷歌一下:
libguide40.dll.zip
libmmd.dll.zip
2.被弃用的set模块,这个只是个警告,也可以不改
C:\Python26>python
Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import MySQLdb
C:\Python26\lib\site-packages\MySQLdb\__init__.py:34: DeprecationWarning: the sets module is deprecated
from sets import ImmutableSet
解决办法:要是每回都跳出来,那多不爽啊,set模块现在已经是内建的数据类型了,ImmutableSet现在成了frozenset。因此需要改成:
1) file “__init__”:
from sets import ImmutableSet
class DBAPISet(ImmutableSet):
改为
class DBAPISet(frozenset) :
2) file “converters.py”, 删除:
from sets import BaseSet, Set
3) file “converters.py”, 将 “Set”改为“set” (IMPORTANT: 共有两处):
line 45: return set([ i for i in s.split(',') if i ])
line 129: set: Set2Str,
最新消息,你可以去这里下载没有任何问题的MySQLdb,国外的大牛所作:
MySQL-python
Windows 64bit and 32bit distributions
相关文章推荐
- Windows+Python2.6下安装MySQLdb驱动
- Windows+Python2.6下安装MySQLdb驱动
- python安装MySQLdb:在windows下或linux下(以及eclipse中pydev使用msqldb的配置方法)
- windows 下安装 python 的 mysqldb 模块
- python安装MySQLdb:在windows下或linux下(以及eclipse中pydev使用msqldb的配置方法)
- windows 下 python2.6的MySQLdb模块安装问题
- windows 安装 mysqldb-python 问题
- ubuntu上安装python的mysql驱动 MySQLDb出现的问题
- python MySQLdb Windows下安装教程及问题解决方法
- Windows下安装MySQLdb, Python操作MySQL数据库的增删改查
- python MySQLdb在windows环境下的快速安装、问题解决方式
- Ubuntu下python安装mysqldb(驱动)
- python MySQLdb在windows环境下的快速安装、问题解决方式
- Windows下安装Python数据库模块--MySQLdb
- Windows下安装mysql-python(MySQLdb)诺干问题及解决方法
- windows环境下安装python MySQLdb遇到的问题以及解决方案
- Windows下安装mysql-python(MySQLdb)问题记录
- Windows上面安装MySQL-Python-1.2.3(Mysqldb- error: Unable to find vcvarsall.bat)
- Windows下安装mysql-python(MySQLdb)诺干问题及解决方法
- python MySQLdb在windows环境下的快速安装