The following code works fine for me, can you try pip install mp_api==0.45.13 emmet-core==0.86.0 pydantic==2.12.0 if it’s not working for you?
from mp_api.client import MPRester
with MPRester() as mpr:
docs = mpr.materials.summary.search(has_props=['elasticity'],fields=['material_id'])
mpids = [doc.material_id for doc in docs]