NotImplementedError: when using '.get_dataframe' from MPDataRetrieval

When I was running .get_dataframe, some errors occurred. Does anybody know the reason?

from matminer.data_retrieval.retrieve_MP import MPDataRetrieval
api_key = ‘XXXXXXXXXXXXXX’
mp = MPDataRetrieval(api_key=api_key)
df_mp = mp.get_dataframe(criteria=‘Si’, properties=[‘band_gap’])


NotImplementedError Traceback (most recent call last)
Cell In[20], line 1
----> 1 df_mp = mp.get_dataframe(criteria=‘Si’, properties=[‘band_gap’])

File F:\miniconda3\lib\site-packages\matminer\data_retrieval\retrieve_MP.py:56, in MPDataRetrieval.get_dataframe(self, criteria, properties, index_mpid, **kwargs)
39 def get_dataframe(self, criteria, properties, index_mpid=True, **kwargs):
40 “”"
41 Gets data from MP in a dataframe format. See api_link for more details.
42
(…)
54 Returns (pandas.Dataframe):
55 “”"
—> 56 data = self.get_data(criteria=criteria, properties=properties, index_mpid=index_mpid, **kwargs)
57 df = pd.DataFrame(data, columns=properties)
58 for prop in [“dos”, “phonon_dos”, “phonon_bandstructure”, “phonon_ddb”]:

File F:\miniconda3\lib\site-packages\matminer\data_retrieval\retrieve_MP.py:99, in MPDataRetrieval.get_data(self, criteria, properties, mp_decode, index_mpid)
97 if index_mpid and “material_id” not in properties:
98 properties.append(“material_id”)
—> 99 data = self.mprester.query(criteria, properties, mp_decode=mp_decode)
100 return data

File F:\miniconda3\lib\site-packages\mp_api\client\mprester.py:1190, in MPRester.query(*args, **kwargs)
1184 def query(*args, **kwargs):
1185 “”"
1186 The MPRester().query method has been replaced with the MPRester().summary.search method.
1187 Note this method also no longer supports direct MongoDB-type queries. For more information,
1188 please see the new documentation.
1189 “”"
→ 1190 raise NotImplementedError(
1191 “”"
1192 The MPRester().query method has been replaced with the MPRester().summary.search method.
1193 Note this method also no longer supports direct MongoDB-type queries. For more information,
1194 please see the new documentation.
1195 “”"
1196 )

NotImplementedError:
The MPRester().query method has been replaced with the MPRester().summary.search method.
Note this method also no longer supports direct MongoDB-type queries. For more information,
please see the new documentation.

Hi, may I ask if you have solved this problem?

I think you can update your python version. Using python 3.9.