我是靠谱客的博主 单纯美女,这篇文章主要介绍python错误合集:Using or importing the ABCs from ‘collections‘ instead of from ‘collections.abc‘,现在分享给大家,希望可以做个参考。

错误信息:

DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working

弃用警告:从collections中导入ABCs已被弃用,并在python3.3和python3.9中将停止使用,可使用collections.abc代替

出处:

在使用collections包时

import collections
if isinstance(item, collections.Sequence) and len(item) == 0:
    return True

解决

from collections.abc import Sequence
if isinstance(item, Sequence) and len(item) == 0:
    return True

最后

以上就是单纯美女最近收集整理的关于python错误合集:Using or importing the ABCs from ‘collections‘ instead of from ‘collections.abc‘的全部内容,更多相关python错误合集:Using内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(67)

评论列表共有 0 条评论

立即
投稿
返回
顶部