juanmc2005 / diart

A python package to build AI-powered real-time audio applications
https://diart.readthedocs.io
MIT License
903 stars 76 forks source link

ImportError: cannot import name 'get_cmap' from 'matplotlib.cm' #234

Closed realchandan closed 1 month ago

realchandan commented 1 month ago

Everytime I try to run diart.stream -h

I get ImportError: cannot import name 'get_cmap' from 'matplotlib.cm'

Which is coming from pyannote/core/notebook.py, line 129

I tried installing without conda, with conda and even building docker image from the Dockerfile here

But I still get ImportError: cannot import name 'get_cmap' from 'matplotlib.cm' (/opt/venv/lib/python3.11/site-packages/matplotlib/cm.py)

I think some recent dependency change broke this whole thing.

realchandan commented 1 month ago

Update: It works for matplotlib==3.8.0 but doesn't work for 3.9.0

juanmc2005 commented 1 month ago

Hi @realchandan thank you for reporting this! I'll address the compatibility issue for the next release

plischwe commented 1 month ago

I tried 3.8 and that doesn't seem to work. I noticed the traditional cmap functionality works until 3.5.0, I see a deprecation notice in the 3.6.0 release.

juanmc2005 commented 1 month ago

After some digging, it looks like this is coming from pyannote.core. It looks like the error was fixed but never released. I just opened an issue to ask for a new release with the fix: https://github.com/pyannote/pyannote-core/issues/100

juanmc2005 commented 1 month ago

I just merged this fix as part of PR #237. Until v0.10 is released, this problem can be solved by installing matplotlib 3.5.x as mentioned above