NameError: name 'json' is not defined
I have also encountered a similar issue, pip failing to install json and math modules (using python 3.x). Finally, I discovered that some modules you simply do not have to install - they are already BUILT-IN. :) Of course, you still have to add "import json" at the top of your .py file. Hope this helps somebody.
If it's not defined in your code, you need to import it. This is exactly the same as any name in Python; you can't use something until you have defined it.
import json