3

Getting this error message:

MatplotlibDeprecationWarning: The finance module has been deprecated in mpl 2.0 and will be removed in mpl 2.2. Please use the module mpl_finance instead.

How do I put in place the mpl_finance package instead. I have it installed in pip, but what is the proper import phraseology?

import datetime as dt
import matplotlib.pyplot as plt
from matplotlib import style
from matplotlib.finance import candlestick_ohlc
import matplotlib.dates as mdates
import pandas as pd
import pandas_datareader.data as web
from googlefinance import getQuotes
import json
from datetime import datetime
from forex_python.converter import CurrencyRates
from yahoo_finance import Share
sgerbhctim
  • 3,420
  • 7
  • 38
  • 60

3 Answers3

7

All code for matplotlib.finance moved to a separate repository. Here is an example of usage. To answer your question:

from mpl_finance import candlestick_ohlc
Oleg Medvedyev
  • 1,574
  • 14
  • 16
2

To import a module which is installed through pip with the name x you would mostly want to do import x.

So, here

import mpl_finance

or to get one of its functions, e.g.

from mpl_finance import candlestick_ohlc
ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712
0

new version can be found here: https://pypi.org/project/mplfinance/

Daniel Goldfarb
  • 6,937
  • 5
  • 29
  • 61