Python/matplotlib : getting rid of matplotlib.mpl warning

Vince picture Vince · Jul 1, 2014 · Viewed 20.5k times · Source

I am using matplotlib using python 3.4. When I start my program, I have the following warning message:

C:\Python34-32bits\lib\site-packages\matplotlib\cbook.py:123: MatplotlibDeprecationWarning: The matplotlib.mpl module was deprecated in version 1.3. Use import matplotlib as mpl instead. warnings.warn(message, mplDeprecation, stacklevel=1)

As far as I know I do not use mpl, and all my imports concerning matplotlib are:

import matplotlib.pyplot as plt
import matplotlib.animation as animation

Anything I should do ?

Answer

CT Zhu picture CT Zhu · Jul 1, 2014

You can suppress that particular warning, which is probably the preferred way:

import warnings
import matplotlib.cbook
warnings.filterwarnings("ignore",category=matplotlib.cbook.mplDeprecation)