Upgrade matplotlib installation issues

Hi, I recently tried to upgrade Matplotlib in my terminal via pip install --upgrade matplotlib. However, it resulted in errors when I’m simply trying to import matplotlib.pyplot. I uninstalled and installed several times but I still get errors when I import matplotlib.pyplot.

AttributeError: type object ‘Axis’ has no attribute ‘_set_ticklabels’

For context, the Python interpreter is 3.10.6 and I am using Windows 10.

That method was removed in PR 24577 and was private internal functionality. We do not use it internally, so there must be something calling that directly elsewhere, but no idea where based on what you have posted here.

Almost all the tutorial code I could find online need from mpl_toolkits.mplot3d import Axes3D, which will return
AttributeError: type object 'Axis' has no attribute '_set_ticklabels' now,
then how can I plot 3d with matplotlib now?

@qianruzhou it’s likely you have installed different matplotlib versions in different places. Please see [Bug]: ImportError when using Matplotlib v3.8.0 in Python package tests · Issue #26827 · matplotlib/matplotlib · GitHub