This may be a PyCDT question, but the error is attributed to MPRester.
It should be read from the .pmgrc.yaml file but I am assuming from the error that the file may not be found. I’ve seen two different ways for the file to read the API key. Either,
PMG_MAPI_KEY:
or
MAPI_KEY:
I have both in the file now and neither are read.
Any advice is welcome. Thank you.
1 Like
Have you double-checked that you updated the pmgrc.yaml file with the correct API key (from your MP account)?
Yes, I have check it is the correct key.
New users can only place one image in post so here is the code producing the error,
I see. Is the yaml file located in your home directory?
Anyway, for the time being, you could just explicitly specify the key in your code:
cpa = MPChemPotAnalyzer(mpid='mp-2534', mapi_key='pasteyourmapikeyhere')
1 Like
That worked for me, thank you!
The .pmgrc.yaml is in the %USERPROFILES% directory. It was auto written there.
You can also use:
from pymatgen import SETTINGS
to see if your .pmgrc.yaml
file is being used correctly. I believe setting PMG_MAPI_KEY
as an environment variable should also work.
1 Like
@mkhorton, it looks like my SETTINGS are empty, so with that I don’t think my .pmgrc.yaml file is being read.