From mp_api.client import MPRester Error (Python 3.9)

Installed mp-api and upgraded successfully
But when running “from mp_api.client import MPRester”, I got this error:

ImportError: cannot import name ‘PatchedPhaseDiagram’ from ‘pymatgen.analysis.phase_diagram’ (/Users/yiqun/opt/anaconda3/envs/xenonpy_env/lib/python3.9/site-packages/pymatgen/analysis/phase_diagram.py)

I felt confused for getting a pymatgen error with the new API. Other information you may need, I ran it on JupyterNotebook and my operating system is MacOS Ventura 13.0.

1 Like

Hi @Yiqun,

I think if you update your pymatgen installation, it should work.

– Jason

1 Like

@munrojm is the minimum pymatgen version in mp-api set appropriately?