BaderAnalysis - Help

Hi everyone,

I would like some help with the BaderAnalysis
I would like to use pymatgen.command_line.bader_caller to to calculate charge.

from pymatgen.command_line.bader_caller import BaderAnalysis
test_bader = BaderAnalysis.from_path('./Al_Fe_Graphite/XFe_Graphite/DOS_Cal/CHGCAR',)
but i got an error said that
BaderAnalysis requires the executable bader to be in the path. Please download the library at and compile the executable.

Do I need to pre-process the CHGCAR file for BaderAnalysis?
If I want to get the charge for specific site, I can just use test_bader.get_charge(site#) right?

Thank you for everyone time!

1 Like

Hi @Ngan_Huynh,

No pre-processing required, though the bader tool documentation suggests using the AECCAR might give better results – pymatgen will do this for you automatically if the AECCAR are present.

The error message simply says that you need to install bader as well – note that pymatgen gives another interface to bader, but the bader tool itself also needs to be installed.

It looks like the link is out of date, the current link is:

I would recommend reading the bader documentation at that link before using the pymatgen interface.



1 Like

Hi Matt,

I had bader installed and also placed a bader insde the folder that I was working on and got into this error msg.

Do you have any idea how to fix this?
Thank you for your time!