1
votes

I am using Spyder 3.2.3 and Python 3.6

Sometimes when I run the following code, it works.

symbol='AMD'
start = dt.datetime(2015, 1, 1)
end = dt.datetime.now()  
df = web.DataReader(symbol, 'robinhood', start, end)

But sometimes it gives the following error, without changing anything:

Traceback (most recent call last):

File "", line 4, in df = web.DataReader(symbol, 'robinhood', start, end)

File "/Users/vinceskretch/anaconda/lib/python3.6/site->packages/pandas_datareader/data.py", line 391, in DataReader session=session).read()

File "/Users/vinceskretch/anaconda/lib/python3.6/site->packages/pandas_datareader/base.py", line 77, in read return self._read_one_data(self.url, self.params)

File "/Users/vinceskretch/anaconda/lib/python3.6/site->packages/pandas_datareader/base.py", line 86, in _read_one_data out = self._get_response(url, params=params).json()

File "/Users/vinceskretch/anaconda/lib/python3.6/site->packages/pandas_datareader/base.py", line 136, in _get_response last_response_text = response.text.encode(response.encoding)

TypeError: encode() argument 1 must be str, not None

The code used to work fine for 6 months.

1

1 Answers

1
votes

It appears that Robinhood has shut down this endpoint. If that is the case, the Robinhood data connection will likely be deprecated in pandas-datareader. For now, other data sources such as Quandl or Alpha Vantage can retrieve the data which you are requesting.