pythonmore-itertools

Python3.8 cannot import name 'windowed_complete'


Ubuntu 20.04 Python 3.8

Got error

 ImportError: cannot import name 'windowed_complete' from 'more_itertools'

However more_itertools is clearly installed.

Is it possible, that Python 3.9 required to run windowed_complete ?

Or how this error should be resolved ?

Traceback (most recent call last):
  File "diarize.py", line 9, in <module>
    from nemo.collections.asr.models.msdd_models import NeuralDiarizer
  File "/home/admin/.local/lib/python3.8/site-packages/nemo/collections/asr/__init__.py", line 15, in <module>
    from nemo.collections.asr import data, losses, models, modules
  File "/home/admin/.local/lib/python3.8/site-packages/nemo/collections/asr/losses/__init__.py", line 16, in <module>
    from nemo.collections.asr.losses.audio_losses import SDRLoss
  File "/home/admin/.local/lib/python3.8/site-packages/nemo/collections/asr/losses/audio_losses.py", line 21, in <module>
    from nemo.collections.asr.parts.preprocessing.features import make_seq_mask_like
  File "/home/admin/.local/lib/python3.8/site-packages/nemo/collections/asr/parts/preprocessing/__init__.py", line 16, in <module>
    from nemo.collections.asr.parts.preprocessing.features import FeaturizerFactory, FilterbankFeatures, WaveformFeaturizer
  File "/home/admin/.local/lib/python3.8/site-packages/nemo/collections/asr/parts/preprocessing/features.py", line 44, in <module>
    from nemo.collections.asr.parts.preprocessing.perturb import AudioAugmentor
  File "/home/admin/.local/lib/python3.8/site-packages/nemo/collections/asr/parts/preprocessing/perturb.py", line 50, in <module>
    from nemo.collections.common.parts.preprocessing import collections, parsers
  File "/home/admin/.local/lib/python3.8/site-packages/nemo/collections/common/parts/preprocessing/collections.py", line 23, in <module>
    from nemo.collections.common.parts.preprocessing import manifest, parsers
  File "/home/admin/.local/lib/python3.8/site-packages/nemo/collections/common/parts/preprocessing/parsers.py", line 23, in <module>
    from nemo.collections.common.parts.preprocessing import cleaners
  File "/home/admin/.local/lib/python3.8/site-packages/nemo/collections/common/parts/preprocessing/cleaners.py", line 17, in <module>
    import inflect
  File "/home/admin/.local/lib/python3.8/site-packages/inflect/__init__.py", line 80, in <module>
    from more_itertools import windowed_complete
ImportError: cannot import name 'windowed_complete' from 'more_itertools' (/usr/lib/python3/dist-packages/more_itertools/__init__.py)```


Solution

  • pip install more-itertools==10.3.0 (latest version)

    solved it