api icon indicating copy to clipboard operation
api copied to clipboard

Import error with pymatgen 2022.5.19

Open cpashartis opened this issue 2 years ago • 3 comments

Hello,

There seems to be an import error on trying from mp_api.client import MPRester

ImportError: cannot import name 'PatchedPhaseDiagram' from 'pymatgen.analysis.phase_diagram' ([...]/pymatgen/analysis/phase_diagram.py)

I'm using version 0.30.8 and pymatgen 2022.5.19 (it seems that this class does not exist and is expected to be in the API)

cpashartis avatar Jan 23 '23 16:01 cpashartis

Hi @cpashartis, thanks for bringing this up. Is it not possible for you to update pymatgen?

munrojm avatar Jan 23 '23 19:01 munrojm

For my research group, there are quite a few changes happening in pymatgen with the API in the past year so we tend to keep copies that we know work internally. If you don't want to make something compatible, might I suggest to update your requirements file to use a new pymatgen (I think .7.19 works).

cpashartis avatar Jan 24 '23 09:01 cpashartis

@cpashartis, that is fair. Since the dependency solver can be a bit finicky with pymatgen and mp_api, we have elected to be conservative on pinning versions. However, with a large API change it is probably warranted as you suggest.

munrojm avatar Jan 24 '23 21:01 munrojm