You can also install simplejson.
If you have pip (see https://pypi.python.org/pypi/pip) as your Python package manager you can install simplejson with:
pip install simplejson
This is similar to the comment of installing with easy_install, but I prefer pip to easy_install as you can easily uninstall in pip with "pip uninstall package".
Answer from bluszcz on Stack OverflowYou can also install simplejson.
If you have pip (see https://pypi.python.org/pypi/pip) as your Python package manager you can install simplejson with:
pip install simplejson
This is similar to the comment of installing with easy_install, but I prefer pip to easy_install as you can easily uninstall in pip with "pip uninstall package".
AFAIK the json module was added in version 2.6, see here. I'm guessing you can update your python installation to the latest stable 2.6 from this page.
python - How to import `json` package in python3.6 - Stack Overflow
python 2.7 - "pip install json" fails on Ubuntu - Stack Overflow
import json > NameError: name 'json' is not defined
My first ever article: "Finding the fastest Python JSON library on all Python versions (8 compared)"
» pip install jsons
» pip install pypi-json
» pip install simplejson
» pip install json3
json is a built-in module, you don't need to install it with pip.
While it's true that json is a built-in module, I also found that on an Ubuntu system with python-minimal installed, you DO have python but you can't do import json. And then I understand that you would try to install the module using pip!
If you have python-minimal you'll get a version of python with less modules than when you'd typically compile python yourself, and one of the modules you'll be missing is the json module. The solution is to install an additional package, called libpython2.7-stdlib, to install all 'default' python libraries.
sudo apt install libpython2.7-stdlib
And then you can do import json in python and it would work!