Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with Latest yfianance 1.2.1 #1261

Closed
prolexgreen opened this issue Dec 20, 2022 · 6 comments
Closed

Error with Latest yfianance 1.2.1 #1261

prolexgreen opened this issue Dec 20, 2022 · 6 comments

Comments

@prolexgreen
Copy link

Traceback (most recent call last):
File "C:\Users\coolb\anaconda3\lib\tkinter_init_.py", line 1892, in call
return self.func(*args)
File "C:\Users\coolb\Downloads\Stock-Prediction-UI-master (1)\Stock-Prediction-UI-master\app.py", line 91, in run
stock_data = data.DataReader(STOCK,
File "C:\Users\coolb\anaconda3\lib\site-packages\pandas\util_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "C:\Users\coolb\anaconda3\lib\site-packages\pandas_datareader\data.py", line 370, in DataReader
return YahooDailyReader(
File "C:\Users\coolb\anaconda3\lib\site-packages\pandas_datareader\base.py", line 253, in read
df = self._read_one_data(self.url, params=self._get_params(self.symbols))
File "C:\Users\coolb\anaconda3\lib\site-packages\pandas_datareader\yahoo\daily.py", line 153, in _read_one_data
data = j["context"]["dispatcher"]["stores"]["HistoricalPriceStore"]
TypeError: string indices must be integers

@ValueRaider
Copy link
Collaborator

Provide simple code that reproduces your problem

@noellwes
Copy link

I have been having this same issue since Friday, none of the patches seem to help. I think it relates to pandas data reader.

My programs start with the following:

import pandas as pd
import numpy as np
import yfinance as yf
import datetime as dt
import pandas_datareader.data as web
from pandas_datareader import data as pdr

start = dt.datetime(2016, 1, 1)
end = dt.datetime.today()
df = web.DataReader('AAPL','yahoo', start, end)
stock= "AAPL"
fig = plt.figure('AAPL')
start = dt.datetime(2016, 1, 1)
end = dt.date.today()
dividends = web.DataReader('AAPL', 'yahoo-dividends', start, end)
dividends.head()

@ValueRaider
Copy link
Collaborator

ValueRaider commented Dec 20, 2022

The bug is occurring where pandas_datareader tries to read 'root.App.main', which Yahoo encrypted recently. Problem is that package nothing to do with yfinance, doesn't appear in the Traceback. Their issue

@ValueRaider ValueRaider closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2022
@JoaoGoncalvesCS
Copy link

I appear to have the same issue, is there anyway we can overcome this issue? Any ideas ? Could we change the source maybe ?

@ValueRaider
Copy link
Collaborator

ValueRaider commented Dec 24, 2022

You got two options:

  1. Go to their GitHub project and ask them to fix. Nothing to do with this project
  2. Switch to yfinance

@noellwes
Copy link

There is a comment in the linked thread about overide

pydata/pandas-datareader#952

Yf.pdr_overide()

it fixed my programs. (Using updated yfinance ect)

Goodluck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants