Hello, fredapi package is succesfully installed in my environment. Importing fredapi and creating the fred object using my api key works. However, when actual pulling data using get_series I get an error. I don’t get this error using other platforms (like datacamp notebook).
import fredapi as Fred
fred=Fred(api_key='some number')
sp500=fred.get_series('SP500') #pull sp500 prices
this is the error I get
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_12768\3735180914.py in <module>
1 fred = Fred(api_key='48687714d90448d876bb115d06578128')
----> 2 fred.get_series('SP500')
~\anaconda3\envs\my_models\lib\site-packages\fredapi\fred.py in get_series(self, series_id, observation_start, observation_end, **kwargs)
133 raise ValueError('No data exists for series id: ' + series_id)
134 data = {}
--> 135 for child in root.getchildren():
136 val = child.get('value')
137 if val == self.nan_char:
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'
Any idea what is causing this? Thank you.