Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems with yfinance package in Python

I am currently trying to use the yfinance package in Python, but am running into problems. When I run

import yfinance as yf
msft = yf.Ticker('MSFT')
msft.info

However, When I run this code I get the error message of :Exception: yfinance failed to decrypt Yahoo data response. WARNING: No decryption keys could be extracted from JS file. Falling back to backup decrypt methods.

I am unsure what to do, for a month ago, this same code worked for me. I am running jupyter notebooks on mac. I redownloaded python, but am to no avail. I followed the advice from >https://github.com/ranaroussi/yfinance>.

like image 200
Grant Weaver Avatar asked Sep 01 '25 11:09

Grant Weaver


1 Answers

Read through the discussion here.
As to " for a month ago, this same code worked for me", here definitely gives a sense that Yahoo has been actively adjusting things on their end very recently and changes need to be made to accomodate that.

like image 105
Wayne Avatar answered Sep 03 '25 23:09

Wayne