16

Python 3.4を使用してmatplotlibを使用しています。プログラムを起動すると、次の警告メッセージが表示されます。

C:\Python34-32bits\lib\site-packages\matplotlib\cbook.py:123: MatplotlibDeprecationWarning: matplotlib.mpl モジュールはバージョン 1.3 で廃止されました。import matplotlib as mpl代わりに使用してください。warnings.warn(メッセージ、mplDeprecation、stacklevel=1)

私が知る限り、私は mpl を使用しておらず、matplotlib に関するすべてのインポートは次のとおりです。

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

私がすべきことはありますか?

4

4 に答える 4

3

インポート時に警告を一時的に抑制することができます

import warnings

def fxn():
    warnings.warn("deprecated", DeprecationWarning)

with warnings.catch_warnings():
    warnings.simplefilter("ignore")
    fxn()
于 2014-07-01T05:09:49.203 に答える