abinit / abipy

Open-source library for analyzing the results produced by ABINIT
http://abinit.github.io/abipy
Other
117 stars 96 forks source link

Problems with newer versions of pymatgen #223

Closed thomaslettau closed 3 years ago

thomaslettau commented 3 years ago

If I try to execute

abiopen.py graphene_o_DS2_GSR.nc --expose -sns=talk

I get the following error:

AttributeError: module 'pymatgen' has no attribute 'Structure'

It can be fixed be replacing pymatgen.Structure with pymatgen.core.Structure in abipy/core/structure.py and from pymatgen import SETTINGS with from pymatgen import SETTINGS in abipy/core/restapi.py

gmatteo commented 3 years ago

Old versions of abipy (version <= 0.9) are not compatible with recent versions of pymatgen due to a refactoring of the imports that broke backward compatibility.

I suggest to update your version of abipy to 0.9 with

pip install abipy -U

Alternatively, you may want to install abipy from the conda-force channel. with:

conda install abipy -c conda-force

In this case, I would also suggest to install everything in a fresh enviroment.

thomaslettau commented 3 years ago

Thanks alot!