MPWorks icon indicating copy to clipboard operation
MPWorks copied to clipboard

ImportError: cannot import name PMGJSONEncoder

Open matk86 opened this issue 10 years ago • 4 comments

I was able run the example job in the mpworks folder with previous versions. But the recent version is giving me the above mentioned error? It seems like the class PMGJSONEncoder is missing in the newer versions. In the old versions it used be in the pymatgen/serailizers folder.

matk86 avatar Sep 16 '14 01:09 matk86

Hi Kiran,

Please use monty.json.MontyDecoder instead.

Best regards,

Xiaohui

On Mon, Sep 15, 2014 at 6:05 PM, Kiran Mathew [email protected] wrote:

I was able run the example job in the mpworks folder with previous versions. But the recent version is giving me the above mentioned error? It seems like the class PMGJSONEncoder is missing in the newer versions. In the old versions it used be in the pymatgen/serailizers folder.

— Reply to this email directly or view it on GitHub https://github.com/materialsproject/MPWorks/issues/7.

xhqu1981 avatar Sep 16 '14 01:09 xhqu1981

i think in multiple places PMGJSONEncoder class is being tried to import through, for example: mpworks/drones/mp_vaspdrone.py", line 19, in from pymatgen import Composition, PMGJSONEncoder ImportError: cannot import name PMGJSONEncoder

matk86 avatar Sep 16 '14 01:09 matk86

also i was trying to run the example scripts

matk86 avatar Sep 16 '14 01:09 matk86

Hi Kiran

There have been several recent updates to pymatgen that are incompatible with the current version of MPWorks. I will be updating MPWorks sometime soon to account for these changes (although I am on travel the next few days). If you need a solution more quickly you can either downgrade your pymatgen version or you can fork MPWorks and replace the imports (in that case, it would be nice if you can contribute back the changes by submitting a pull request)

computron avatar Sep 16 '14 02:09 computron