DeprecationWarning: the sets module is deprecated
来源:互联网 发布:mysql 错误日志路径 编辑:程序博客网 时间:2024/04/28 23:45
import MySQLdb
报错没有安装库
所以安装了对应版本的数据库模块
今天安装了MySQLdb版本: MySQL-python-1.2.2.win32-py2.6.exe
解决办法
今天下载了MySQL-python-1.2.2.win32-py2.6.rar 想试试python的数据库操作,但是安装时错误
下面是报错截图:
修改__init__.py:
*注释第34行: from sets import ImmutableSet
*在后面一行添加: ImmutableSet = frozenset
*注释第41行e: from sets import BaseSet
*在后面一行添加: BaseSet = set
##### __init__.py
#Line 35
#from sets import ImmutableSet
#class DBAPISet(ImmutableSet):
class DBAPISet(frozenset):
修改converters.py
#Line 37
#from sets import BaseSet, Set
#Line 46
#return Set([ i for i in s.split(',') if i ])
return set([ i for i in s.split(',') if i ])
#Line 132
#Set: Set2Str,
set: Set2Str,
OK,运行import mysqldb
一切正常:
0 0
- DeprecationWarning: the sets module is deprecated
- DeprecationWarning: the sets module is deprecated import sets
- MySQLdb DeprecationWarning: the sets module is deprecated from sets import ImmutableSet
- python连接mysql时 出现DeprecationWarning: the sets module is deprecated
- D:/Python26/lib/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import Immut
- 【转】Python2.6下安装Mysqldb出现DeprecationWarning: the sets module is deprecated from sets错误解决方案
- DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5
- mongoose 连接警告问题(node:148572) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0
- DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instea
- DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in y
- (node:31568) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` inste
- The regenerator/runtime module is deprecated; please import regenerator-runtime/runtime instead.
- The type Contacts is deprecated
- The type SmsMessage is deprecated
- The type SmsMessage is deprecated
- The type MultipartEntity is deprecated
- The type ActionBarActivity is deprecated
- The type SmsMessage is deprecated
- excel 跨表格数据汇总
- 【C语言】C语言字符串函数实现(一)
- 锁帧同步算法
- java字符串内存分析
- epoll为什么这么快,epoll的实现原理
- DeprecationWarning: the sets module is deprecated
- shell判断字符串为空
- 如何优化cocos2d/x程序的内存使用和程序大小
- Android中的Handler机制
- Android的WebView中js与java代码相互调用
- 算法学习--二叉搜索树
- 优化快速排序 C语言代码
- nginx 使用 let's encrypt 配置https
- C++模板数组实现有序数组的排列合并算法