Receiving an AttributeError indicating that the API is returning XML data
kburchfiel opened this issue · 2 comments
kburchfiel commented
After installing the latest version of fredapi and running the following code (from the library homepage):
from fredapi import Fred
fred = Fred(api_key=fred_key)
data = fred.get_series('SP500')
I received the following error message:
[AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren']()
It seems as though the API is retrieving XML data. How can I resolve this?
kburchfiel commented
Update: I installed the latest version available on conda-forge (0.42), but this is less recent than the version available through pip (0.50). After using pip to install the latest version, the code worked. So the error is probably related to conda-forge's outdated fredapi version.