1

I am trying to create a candlestick / OHLC graph in jupyter notebook using closing stock data extracted from Stooq. I tried several different things to try and install mplfinance to get the candlestick_ohc imported, and keep getting different error messages no matter what I try. Below are the different things I tried:

Installed this successfully using Python in Terminal: 'pip install https://github.com/matplotlib/mpl_finance/archive/master.zip'

And this in Terminal, which worked: 'pip install mpl_finance'

1 When I try to type this into Terminal:

'from mpl_finance import candlestick_ohlc'

I get this error message: 'from: can't read /var/mail/mpl_finance'

And yes, I have also upgraded mplfinance as well.

2 I also tried downloading this in Jupyter Notebook:

`import matplotlib.pyplot as plt
from matplotlib.finance import candlestick_ohlc
import matplotlib.dates as mdates'

And get this error message: 'No module named 'matplotlib.finance''

My question is, why do I keep getting error messages for matplotlib.finance when I have installed it in the Terminal? What am I missing or doing wrong?

Daniel Goldfarb
  • 6,937
  • 5
  • 29
  • 61
none
  • 33
  • 1
  • 7
  • 1
    (1) You cannot type python commands in your terminal. You would first need to start a python session; then you can use python commands. (2) `matplotlib.finance` does not exist any more. So you need to use `mpl_finance` (which is also what you have downloaded). – ImportanceOfBeingErnest Jan 21 '20 at 00:04
  • How do I start a Python session? Sorry so new to this all, this is probably so basic! – none Jan 21 '20 at 15:10

1 Answers1

1

There is a new version of matplotlib finance, along with documentation, here:

https://pypi.org/project/mplfinance/

https://github.com/matplotlib/mplfinance

Install with: pip install --upgrade mplfinance

NOTE: The package name no longer has the dash or underscore: It is now mplfinance (not mpl-finance, nor mpl_finance)

Daniel Goldfarb
  • 6,937
  • 5
  • 29
  • 61
  • please kindly have a look at this - https://stackoverflow.com/questions/68789254/modulenotfounderror-no-module-named-mplfinance-errors-out-even-after-pip-st – Dhruva Jain Aug 15 '21 at 06:38