0

I am using python 3.8 in spyder3. I am getting an error while doing:

mp=MPRester('api key')

data = mp.query(criteria={}, properties=['task_id']) #this line raises error

The error is :

NameError: name '**IProgress**' is not defined.

During handling of the above exception, another exception occurred:

ImportError: **FloatProgress** not found. Please update jupyter and ipywidgets.

But I'm not working with Jupyter notebook and ipywidgets is updated. This problem doesn't happen while working in Google collab.

sumedhe
  • 934
  • 1
  • 13
  • 30
Rik Ghosh
  • 23
  • 6

2 Answers2

2

Installing these two worked for me:

pip install ipywidgets IProgress
Abhi25t
  • 3,703
  • 3
  • 19
  • 32
1

I am not answering the error but showing a worked script for me. Using the following approach might help.

from pymatgen import MPRester
api = MPRester("your key")

# criteria you want
criteria={"elements":{"$all": ["O"]}, "nelements":{'$lt':4}}

# properties you want
properties = ["pretty_formula", "cif", "material_id"]

c = api.query(criteria=criteria,properties=properties)
sumedhe
  • 934
  • 1
  • 13
  • 30
hemanta
  • 1,405
  • 2
  • 13
  • 23