pin matplotlib version by n-poulsen · Pull Request #2583 · DeepLabCut/DeepLabCut

Conversation

@n-poulsen

Addresses issue #2581. Replicated in Google Colab and locally. We use this method in many functions

With matplotlib==3.8.4:

>>> import matplotlib as mpl
>>> print(mpl.__version__)
3.8.4
>>> import matplotlib.pyplot as plt
>>> plt.cm.get_cmap
<function _get_cmap at 0x11e9f4430>

With matplotlib==3.9.0:

>>> import matplotlib as mpl
>>> print(mpl.__version__)
3.9.0
>>> import matplotlib.pyplot as plt
>>> plt.cm.get_cmap
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'

@n-poulsen n-poulsen changed the title Niels/pin matplotlib pin matplotlib version

May 20, 2024

MMathisLab

@NadjaBrun

Hi! Thanks for working on this!

I use google colab and just tried to start evaluating. However, the error message remains:
AttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'

Any help is much appreciated!

@MMathisLab

yes, matplotlib just changed, so you will need to explicitly call and older version by running in Colab: !pip install matplotlib==(older version) -- or install from source our package !pip install git+https://github.com/DeepLabCut/DeepLabCut.git; DeepLabCut is not updated on pypi only the repo here

@NadjaBrun

The evaluation step worked! Thank you so much!

Labels