luciano
luciano

Reputation: 9

Error from urllib, what is this error about?

I am getting the following error when using fredapi to fetch data from the FRED website:

Traceback (most recent call last):
File "/xyz/xyz/.local/lib/python3.8/site-packages/fredapi/fred.py", line 64, in __fetch_data
response = urlopen(url)
File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/usr/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/xyz/xyz/xyz.py", line 18, in
DataSetBuilder_1()
File "/xyz/xyz/xyz/xyz.py", line 150, in DataSetBuilder_1
x=fred.get_series(x, columns=[y])
File "/xyz/xyz/.local/lib/python3.8/site-packages/fredapi/fred.py", line 131, in get_series
root = self.__fetch_data(url)
File "/xyz/xyz/.local/lib/python3.8/site-packages/fredapi/fred.py", line 68, in __fetch_data
raise ValueError(root.get('message'))
ValueError: Not Found. The series does not exist.

Does anybody have a clue of what this is about? Thanks in advance!

Upvotes: 0

Views: 1052

Answers (2)

luciano
luciano

Reputation: 9

Many thanks for your inputs. I really appreciate it.

The problem seem to be with the FRED API, several users reported that some series are not accessible. We still do not know why, but this has been raised with the FRED.

Thanks a lot

L.

Upvotes: 0

Michael Robellard
Michael Robellard

Reputation: 2358

An HTTP 404 Error means that the page could not be found. So whatever page fredapi is trying to access cannot be found.

The second error is from Pandas that says that there is no data. Pandas data comes in as either a Series or a DataFrame. This error is being caused by the 404 error above.

You need to make sure the url you are trying to access exists and is returning the expected data.

Upvotes: 2

Related Questions