Search code examples
pythonmatplotlibanacondafinance

module not found matplotlib.finance


I have installed the latest version of Anaconda recently. When I am trying to import matplotlib.finance, I have a module does not exist error in spyder.

matplotlib and mpl-finance are installed already.

What should I do to resolve the issue?

I have the following problem with the following code in python 3.7 from matplotlib.finance import candlestick_ohlc

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

ModuleNotFoundError: No module named 'matplotlib.finance'

Solution

  • matplotlib.finance does not exist (anymore).

    If you have installed mpl-finance, you need to import it as mpl_finance, e.g.

    from mpl_finance import candlestick_ohlc