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/”, 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/”, line 362, in Get_Totaltime
File “/home/nhyen/miniconda3/envs/yen_env/lib/python3.11/site-packages/aicon-2.0.0-py3.11-linux-x86_64.egg/aicon/”, line 143, in Get_Avgacotime
File “/home/nhyen/miniconda3/envs/yen_env/lib/python3.11/site-packages/aicon-2.0.0-py3.11-linux-x86_64.egg/aicon/”, 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/”, line 89, in Get_elastconst
File “/home/nhyen/miniconda3/envs/yen_env/lib/python3.11/site-packages/aicon-2.0.0-py3.11-linux-x86_64.egg/aicon/”, line 53, in Get_AvgLongEConst
struct = pmg.Structure.from_file(filepath + “POSCAR”)
AttributeError: module ‘pymatgen’ has no attribute ‘Structure’
Could you help me?

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.

I am getting the same error. Can you Please specify the steps I need to follow to get rid of this error?Like Where I need to change in the code?

Thank you