回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>使用fredapi从FRED网站获取数据时,我遇到以下错误:</p>
<pre><code>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
</code></pre>
<p>在处理上述异常期间,发生了另一个异常:</p>
<pre><code>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.
</code></pre>
<p>有人知道这是怎么回事吗?提前谢谢</p>