MySQLdb安装的错误说明

1、从http://www.codegood.com/上下载到国外有人编译好的,自己就免去这一环节

2、import MySQLdb时出现如下错误:

Warning (from warnings module):
  File 
"C:\Python26\lib\site-packages\MySQLdb\__init__.py", line 34
    
from sets import ImmutableSet
DeprecationWarning: the sets module 
is deprecated

 

解决方法:

1) 在文件 "__init__" 中将:

from sets import ImmutableSet
class DBAPISet(ImmutableSet):

替换为

class DBAPISet(frozenset)

2) 在文件 "converters.py"中移除:

from sets import BaseSet, Set

3) 在文件 "converters.py", 把 "Set" 改为 "set" (重要提示: 只有2个地方要改):

line 48: return set([ i for i in s.split(',') if i ])
line 128: set: Set2Str

 

 

 

posted @ 2010-09-06 18:12  Done  阅读(334)  评论(0编辑  收藏  举报