找不到模块 matplotlib.finance

module not found matplotlib.finance

我最近安装了最新版本的Anaconda。当我尝试导入 matplotlib.finance 时,我在 spyder 中遇到 module does not exist 错误。

matplotlib and mpl-finance are installed already.

我应该怎么做才能解决这个问题?

我在 python 3.7 中使用以下代码时遇到以下问题 从 matplotlib.finance 导入 candlestick_ohlc

   File "<ipython-input-1-7ea83a59eaf3>", line 1, in <module>
     from matplotlib.finance import candlestick_ohlc

ModuleNotFoundError: No module named 'matplotlib.finance'

matplotlib.finance 不存在(不再)。

如果您已经安装了 mpl-finance,您需要将其导入为 mpl_finance,例如

from mpl_finance import candlestick_ohlc

此模块现在有一个新版本。试试这个:https://pypi.org/project/mplfinance/