Hi,
I was trying to get 4 vasp input files(INCAR, POSCAR, POTCAR, KPOINTS) by material project id. The default functional in potcar is PBE, but I am using GGA, so I set PMG_DEFAULT_FUNCTIONAL
to PW91
, but it didn’t work.
My code as below
from pymatgen.ext.matproj import MPRester
from pymatgen.io.vasp.sets import MPRelaxSet
import os
APIkey = 'XXXXXXXXXX' # update the key when necessary
mpr = MPRester(APIkey)
os.system('pmg config --add PMG_VASP_PSP_DIR G:/pseudo-potential/potpaw_GGA')
os.system('pmg config --add PMG_DEFAULT_FUNCTIONAL PW91')
structure = mpr.get_structure_by_material_id('mp-1')
relaxed_structure = MPRelaxSet(structure)
relaxed_structure.write_input('.')
After running this, I got error message:
File "C:/Users/binxi/Desktop/vaspInputFilesGen/VaspInputsGen.py", line 14, in <module>
relaxed_structure.write_input('.')
File "G:\anaconda\lib\site-packages\pymatgen\io\vasp\sets.py", line 476, in write_input
include_cif=include_cif)
File "G:\anaconda\lib\site-packages\pymatgen\io\vasp\sets.py", line 164, in write_input
vinput = self.get_vasp_input()
File "G:\anaconda\lib\site-packages\pymatgen\io\vasp\sets.py", line 149, in get_vasp_input
potcar=self.potcar)
File "G:\anaconda\lib\site-packages\pymatgen\io\vasp\sets.py", line 124, in potcar
return Potcar(self.potcar_symbols, functional=self.potcar_functional)
File "G:\anaconda\lib\site-packages\pymatgen\io\vasp\inputs.py", line 1733, in __init__
self.set_symbols(symbols, functional, sym_potcar_map)
File "G:\anaconda\lib\site-packages\pymatgen\io\vasp\inputs.py", line 1824, in set_symbols
p = PotcarSingle.from_symbol_and_functional(el, functional)
File "G:\anaconda\lib\site-packages\pymatgen\io\vasp\inputs.py", line 1610, in from_symbol_and_functional
symbol))
OSError: You do not have the right POTCAR with functional PBE and label Cs_sv in your VASP_PSP_DIR
In last line, it says ‘with functional PBE’, but I already set it to ‘PW91’.
Anyone can help?
Thanks!