atreadw1492 / yahoo_fin

Scrape stock price history from new (Spring 2017) Yahoo Finance layout
MIT License
286 stars 125 forks source link

Error after updating to Py 3.7 and reinstalling yahoo_fin #60

Closed seranki closed 3 years ago

seranki commented 3 years ago

After updating to Py 3.7.10 and reinstalling yahoo_fin 0.8.9, I am getting the following error:

`>>> si.get_live_price(ticker)

Traceback (most recent call last):
File "", line 1, in
File "/Volumes/Backup/Users/......./anaconda3/lib/python3.7/site-packages/yahoo_fin/stock_info.py", line 575, in get_live_price
df = get_data(ticker, end_date = pd.Timestamp.today() + pd.DateOffset(10))
File "/Volumes/Backup/Users/......./anaconda3/lib/python3.7/site-packages/yahoo_fin/stock_info.py", line 88, in get_data
raise AssertionError(resp.json())
File "/Volumes/Backup/Users/......./anaconda3/lib/python3.7/site-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/Volumes/Backup/Users/......./anaconda3/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/Volumes/Backup/Users/......./anaconda3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Volumes/Backup/Users/......./anaconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
`

All the modules seem to be satisfying the dependency requirements of yahoo_fin

jaydevshelat commented 3 years ago

+1 something broke in last 12-18 hours. I made no version changes. I have been successfully using Py 3.8.3 and yahoo_fin 0.8.6 for a while now.

seranki commented 3 years ago

@atreadw1492 Please see the author's response to a recent YF issue with a different module: Error raised by query2.finance.yahoo.com #32 It may or may not fix the issue reported above with yahoo_fin

atreadw1492 commented 3 years ago

@seranki @jaydevshelat Please update to the latest version - 0.8.9.1. This should resolve the issues you're seeing.