Tarun Anand
Tarun Anand

Reputation: 41

Python yfinance HTTPError: HTTP Error 404: Not Found

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.

Upvotes: 3

Views: 3489

Answers (1)

Jishan Shaikh
Jishan Shaikh

Reputation: 1806

Update your yfinance package as:

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

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

Upvotes: 4

Related Questions