pandasyahoo-financetradingpandas-datareader

Python, Pandas datareader and Yahoo Error RemoteDataError: Unable to read URL


I am trying to download historical data from Yahoo using Pandas datareader. This is the code that I normally use:

import pandas_datareader as pdr
df = pdr.get_data_yahoo('SPY')

However, I started receiving this error today: RemoteDataError: Unable to read URL: https://finance.yahoo.com/quote/SPY/history?period1=1467511200&period2=1625277599&interval=1d&frequency=1d&filter=history

Does anyone know how to solve it?

Thank you very much in advance!


Solution

  • This has been answered here already. Since now requires headers, pandas and pandas-datareader must be updated. Other libraries working with pdr might give you issues until gets updated or you modify the part of the code which retreives data.

    Have a nice day ;).

    pip install --upgrade pandas
    pip install --upgrade pandas-datareader