Python

Error

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/IPython/core/formatters.py in __call__(self, obj)
    332                 pass
    333             else:
--> 334                 return printer(obj)
    335             # Finally look for special method names
    336             method = get_real_method(obj, self.print_method)

12 frames
/usr/local/lib/python3.7/dist-packages/matplotlib/backends/backend_svg.py in <module>()
     16 import matplotlib as mpl
     17 from matplotlib import _api, cbook, font_manager as fm
---> 18 from matplotlib.backend_bases import (
     19      _Backend, _check_savefig_extra_args, FigureCanvasBase, FigureManagerBase,
     20      RendererBase)

ImportError: cannot import name '_check_savefig_extra_args' from 'matplotlib.backend_bases' (/usr/local/lib/python3.7/dist-packages/matplotlib/backend_bases.py)

解决办法:

reference

# 这个是matplotlib版本问题
!pip install matplotlib==3.0.0
我最开始是使用!pip install --upgrade matplotlibmatplotlib升级到最新版本,奇怪的是把matplotlib升级到最新版本在kaggle平台上不报错,但是在colab上仍然报错
This is just a placeholder img.