arviz
arviz copied to clipboard
mpl incompatibility on ChatGPT
Trying to import arviz on ChatGPT leads to:
----> 3 import arviz as az
4 result = "ArviZ is available."
5 except ImportError:
File ~/.local/lib/python3.8/site-packages/arviz/__init__.py:324
322 import colorcet
323 except ModuleNotFoundError:
--> 324 _mpl_cm("gray", _linear_grey_10_95_c0)
325 _mpl_cm("gray_r", list(reversed(_linear_grey_10_95_c0)))
328 # clean namespace
File ~/.local/lib/python3.8/site-packages/arviz/__init__.py:318, in _mpl_cm(name, colorlist)
316 def _mpl_cm(name, colorlist):
317 cmap = LinearSegmentedColormap.from_list(name, colorlist, N=256)
--> 318 mpl.colormaps.register(cmap, name="cet_" + name)
AttributeError: module 'matplotlib' has no attribute 'colormaps'
I bet the env has an incompatible matplotlib version (installed is 3.4.3.) but I'm wondering if there's an easy way to maybe make it compatible.
The minimum mpl version required for ArviZ is 3.5, when the colormaps module was added, not sure how that env came to be. Is is possible to update matplotlib somehow?
Another alternative would be to avoid triggering that try except, which wouldn't be triggered if colorcet were installed.
It's just whatever openai cobbled together I guess.