Python 3.5.1 : NameError: name json is not defined

Python 3.5.1 : NameError: name json is not defined

You should at first install simplejson to your system to be able to import it:

$ sudo pip3 install simplejson

Then in your code you are now able to import it:

import simplejson as json

From now on you will be able to access simplejson package using json.

Please note, if youre still using python 2 – despite this is not the OPs original question – you should do a

$ sudo pip install simplejson

instead.

Python 3.5.1 : NameError: name json is not defined

Leave a Reply

Your email address will not be published.