首页 > 学院 > 开发设计 > 正文

遇到的小问题,不断更新

2019-11-08 20:26:26
字体:
来源:转载
供稿:网友

python使用版本: 3.5

一、版本问题

1、cpickle not defined

3.5版本中cpickle已经改为_pickle(序列化模块),若想继续使用cpickle,可使用import _pickle as pickle代替

语法:

2、reload not defined

3.x版本中reload已经隶属于imp模块,所以你如果继续使用reload 需要使用from imp import reload

3、module 'sys' has no attribute 'setdefaultencoding'

python3.x默认字符编码为unicode,故此属性已经移除


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表