简体   繁体   中英

ModuleNotFoundError: No module named 'mpl_finance'

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

在此处输入图片说明

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

在此处输入图片说明

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

在此处输入图片说明

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

在此处输入图片说明

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.

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

mpl_finance已被弃用,只需将该模块安装为mplfinance

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

pip install mlp_finance将解决这个问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM