Python yfinance HTTPError: HTTP Error 404: Not Found

Viewed 1457

I am new to python, and I am trying to explore yfinance. This worked a few months ago, but recently when I tried to execute my code with any yfinance modules, I get the following error:

import yfinance as yf
stock='AAPL'
stock_yfin=yf.Ticker("{}".format(stock))
# show institutional holders
stock_yfin.institutional_holders

------------>

HTTPError: HTTP Error 404: Not Found

Is there a workaround to solve this? I have looked into changing my header and session information, but can't seem to figure it out.

1 Answers

Update your yfinance package as:

pip install yfinance --upgrade --no-cache-dir

in your virtual environment or global scope whichever you're using.

Related