Pandas无法识别已安装的matplotlib库。
这是代码
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))
ts = ts.cumsum()
ts.plot()
错误是
c:\users\xxxxx\appdata\local\programs\python\python36\lib\site-packages\pandas\plotting\_core.py in _raise_if_no_mpl()
55 # TODO(mpl_converter): remove once converter is explicit
56 if not _HAS_MPL:
---> 57 raise ImportError("matplotlib is required for plotting.")
58
59
ImportError: matplotlib is required for plotting.