Error importing ``abilab`` - ``pymatgen ModuleNotFound Error``

Dear developers,

I am trying to use Abipy library to plot a band structure computed with Abinit. I completed its installation (including pymatgen’s) following the instructions HERE. However, when I try to import abilab (from abipy import abilab) I am getting a ModuleNotFoundError error, apparently because the pymatgen serialization module is not found.

----> 1 from abipy import abilab

File ~/.local/lib/python3.8/site-packages/abipy/
     12 del sys
     14 #-----------------------------------------------------------------------------
     15 # Setup the top level names
     16 #-----------------------------------------------------------------------------
---> 18 from abipy.core import release
     20 # Release data
     21 __author__ = ''

File ~/.local/lib/python3.8/site-packages/abipy/core/
      1 """Core objects."""
      2 # flake8: noqa
----> 3 from .kpoints import *
      4 from .structure import *
      5 from .symmetries import *

File ~/.local/lib/python3.8/site-packages/abipy/core/
     14 from monty.string import marquee
     15 from pymatgen.core.lattice import Lattice
---> 16 from pymatgen.util.serialization import pmg_serialize, SlotPickleMixin
     17 from abipy.iotools import ETSF_Reader
     18 from import finite_diff

ModuleNotFoundError: No module named 'pymatgen.util.serialization'

I have inspected the pymatgen repo and haven’t found the ~/pymatgen/util/ module either.

Any help on how to sort this out so I can try the nice plot_ebands_spin.ipynb notebook shown HERE ?

Thank you very much!


Dear Alain,

It appears pymatgen have removed this module in a recent commit. For now, what would be best would be to install a version which still has the serialization module.

We will have to accommodate abipy for newer versions of pymatgen though @gmatteo.


Thank you Olivier! I went a little bit back and installed pymatgen-2022.7.25 and it worked.

Best regards,