ModuleNotFoundError: No module named 'mpl_finance'

12.3k Views Asked by At

Hi I am following a tutorial that was using matplotlib.finance to use candlestick.ohlc. When researching I found out that that lib was deprecated and to use mlp_finance. I believe I have installed it by running the command prompt and entering the line pip install mpl_finance. The result that I get this

enter image description here

I tried re running the script but I still get the error:

     from  mpl_finance   import candlestick_ohlc
    ModuleNotFoundError: No module named 'mpl_finance'

I checked the python library path and I don't see a folder labeled mlp_finance(Im not sure if Im suppose to). But I do see a file labeled mpl_finance-0.10.0-py3.7.egg

enter image description here

Any help on resolving this issue? Downloaded the git package and ran the command prompt install

enter image description here

ran the command line pip install git clone https://github.com/matplotlib/mpl_finance.git mpl_finance.git

enter image description here

6

There are 6 best solutions below

1
On BEST ANSWER

pip install mlp_finance will solve the issue

1
On

You need to install matplotlib/mpl_finance at https://github.com/matplotlib/mpl_finance

git clone https://github.com/matplotlib/mpl_finance.git mpl_finance.git
cd mpl_finance.git
python setup.py install
1
On

I've got the same error you told, but I resolved it as below.

First, install mpl_finance

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

Second, upgrade mpl_finance

pip install --upgrade mplfinance

Hope that this will work.

0
On

if you using Anaconda - To install this package with conda run: conda install -c conda-forge mplfinance

1
On

mpl_finance has been deprecated, just install the module as mplfinance.

1
On

If you want to follow that tutorial on mpl_finance, you can do so by installing the new mplfinance:

pip install --upgrade mplfinance

Then every place the tutorial tells you to import from mpl_finance change the import to
from mplfinance.original_flavor, for example:

change:

from  mpl_finance   import candlestick_ohlc

to

from mplfinance.original_flavor import candlestick_ohlc