‘module’ object has no attribute ‘loads’ while parsing JSON using python

File "json.py", line 2, in <module>
  import json

This line is a giveaway: you have named your script “json”, but you are trying to import the builtin module called “json”, since your script is in the current directory, it comes first in sys.path, and so that’s the module that gets imported.

You need to rename your script to something else, preferrably not a standard python module.

Leave a Comment