我刚刚在我的新电脑上安装了python3,并尝试使用pip
安装一些库(numpy
,cython
,cymem
(,我得到
AttributeError: module 'collections' has no attribute 'Iterable'
但是像nltk
和cytest
这样的库安装正常
集合。可迭代已弃用。 将其替换为collections.abc.Iterable。
请参阅此答案以了解兼容性: https://stackoverflow.com/a/53978543/13369176
由于这是一个通常发生在库代码中而不是我的问题,因此快速修复可能是
import collections
写
import collections.abc as collections
并在相应项目的存储库中填充错误。