Since matplotlib.finance has been deprecated, how can I use the new mpl_finance module?

In 2020, one can now pip install mplfinance


What this warning tells you is that the finance module will be removed at some point.

At the moment you don't need to worry about this warning. It will only affect you when you update to a yet to be released version 2.2 of matplotlib, in which case you'll need to change your imports.

If you already want to be compatible with future versions now, you can download the mpl_finance module from https://github.com/matplotlib/mpl_finance .

After having downloaded the files, you may install in the usual way,

python setup.py install

Alternatively you may try installing through pip,

pip install https://github.com/matplotlib/mpl_finance/archive/master.zip

The reason for this is that the people at matplotlib want to keep their code clean and not maintain a specialized sidepackage like this in the main code. They probably also do not want to maintain the package and spend resources on it, which can be better used in the core development.


Since mpl_finace is not on pip now, you may also want to use following command to install mpl_finance by pip:

pip install https://github.com/matplotlib/mpl_finance/archive/master.zip