Error with MPRelaxSet generated INCAR

Hi there,

New to computational chem, and recently started using automated DFT using pymatgen. This is just a test on one of the materials I want to examine to try a simple MPRelaxSet calc. I am following the instructions from the MP workshop page.

from matplotlib import pyplot as plt
from pymatgen.analysis.adsorption import *
from pymatgen.core import Lattice, Molecule, Structure
from pymatgen.core.surface import generate_all_slabs
from mp_api import MPRester

MP_API_KEY = ####
mpr = MPRester(MP_API_KEY)

matIDsAl= mpr.get_materials_ids(“Ni-Al”)
struct = mpr.get_structure_by_material_id(matIDsAl[0])

from pymatgen.io.vasp.inputs import Poscar,Kpoints
from pymatgen.io.vasp.sets import MPRelaxSet
#custom_incar = {‘ISMEAR’: 2, ‘SIGMA’: 0.2} #To be added later

k_dict = {‘nkpoints’: 0,
‘generation_style’: ‘Monkhorst Planck’,
‘kpoints’: [[6,6,6]],
‘usershift’: [0,0,0],
‘comment’: ‘Automatic mesh’}
custom_kpoints = Kpoints.from_dict(k_dict)
relax_set = MPRelaxSet(structure=struct, user_kpoints_settings = custom_kpoints)
poscar = Poscar(struct, comment=“Al3Ni2”)

relax_set.kpoints
relax_set.incar
relax_set.write_input(output_dir=“./RelaxSetTest”)

I don’t open or do anything to manipulate these files. When I upload them to the cluster to run ‘vasp_std’, it returns

" Error reading item ISPIN from file INCAR. || Error code was IERR= 5…"

What am I doing wrong and how can I possibly correct this?

I can’t tell from this code alone, but my guess is there might be a hidden/invisible character in your INCAR file. This sometimes happens during copy/paste

Thank you for your input, it seems consistent with other similar posts.

Is there any method by which I can scan the INCAR file to look for these characters? I didn’t modify them at all and simply uploaded them.