8

I just installed python3 on my new pc and tried to install some libraries (numpy, cython, cymem) using pip and I get

AttributeError: module 'collections' has no attribute 'Iterable'

but libraries like nltk and cytest installed okay

rubo77
  • 19,527
  • 31
  • 134
  • 226
Saugat Timilsina
  • 91
  • 1
  • 1
  • 6

2 Answers2

9

collections.Iterable is deprecated. Replace it with collections.abc.Iterable.

See this answer for compatibility : https://stackoverflow.com/a/53978543/13369176

0

Since this is a problem usually occurring in library code not mine, the quick fix might be instead of

import collections

to write

import collections.abc as collections

and fill the bug in the repository of the respective project.

VojtaK
  • 483
  • 4
  • 13