Reputation: 31
I am using python 3.8.5 in jupyter notebook. I am getting an error while doing:
from matminer.data_retrieval.retrieve_MP import MPDataRetrieval
mpdr = MPDataRetrieval(api_key='my_api_key')
The error is :
ImportError: cannot import name 'MPRester' from 'pymatgen' (unknown location)
I have installed pymatgen and matminer. Why did this error occur?
Upvotes: 2
Views: 3462
Reputation: 138
It was moved to from pymatgen.ext.matproj import MPRester
.
So the matminer code is outdated, try updating it and/or downgrading your pymatgen package to an older version.
see pymatgen docs.
Upvotes: 4