I am running Python 2.7 (x64 Linux) and trying to convert a dict to a JSON object.
>>> import sys
>>> sys.version_info
sys.ver
I have discussed the problem and solution below
Problem: when you call the import function on python, python try to find the module inside your working directory, if it does not find inside your local directory, that's when it will look for standard libraries and other global repos. Hence, if you try to import json module, then it'll try to find it inside your directory and If you have a file named 'json.py', python will load this module and tries to find 'dump' function inside your json.py. if it does not find 'dump' function inside your file, it will throw an error 'module' object has no attribute 'dumps'.
Resolution: rename your 'json.py' file into different name: like json_file.py or anything but 'json.py'.