Module 'pymatgen' has no attribute 'Structure'

I run AICON2 program and I get the error:
File “/home/nhyen/miniconda3/envs/yen_env/lib/python3.11/site-packages/aicon-2.0.0-py3.11-linux-x86_64.egg/aicon/band.py”, line 159, in Get_transport_para
self.RT.Get_Totaltime(filepath, ACO = True, OPT = True, IMP = True)
File “/home/nhyen/miniconda3/envs/yen_env/lib/python3.11/site-packages/aicon-2.0.0-py3.11-linux-x86_64.egg/aicon/relaxtime.py”, line 362, in Get_Totaltime
self.ACO.Get_Avgacotime(filepath)
File “/home/nhyen/miniconda3/envs/yen_env/lib/python3.11/site-packages/aicon-2.0.0-py3.11-linux-x86_64.egg/aicon/relaxtime.py”, line 143, in Get_Avgacotime
self.Get_relaxtimefun(filepath)
File “/home/nhyen/miniconda3/envs/yen_env/lib/python3.11/site-packages/aicon-2.0.0-py3.11-linux-x86_64.egg/aicon/relaxtime.py”, line 135, in Get_relaxtimefun
self.Get_elastconst(filepath + ‘elastic/’)
File “/home/nhyen/miniconda3/envs/yen_env/lib/python3.11/site-packages/aicon-2.0.0-py3.11-linux-x86_64.egg/aicon/relaxtime.py”, line 89, in Get_elastconst
self.Elastic.Get_AvgLongEConst(filepath)
File “/home/nhyen/miniconda3/envs/yen_env/lib/python3.11/site-packages/aicon-2.0.0-py3.11-linux-x86_64.egg/aicon/elastic.py”, line 53, in Get_AvgLongEConst
struct = pmg.Structure.from_file(filepath + “POSCAR”)
^^^^^^^^^^^^^
AttributeError: module ‘pymatgen’ has no attribute ‘Structure’
Could you help me?
Thanks.

Looks like that is a package using an older version of pymatgen. If you have a newer pymatgen version you will need to change that line in the package’s code to: pmg.core.Structure.from_file

1 Like

Thank you for your reply. I will try.