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
Even I was facing similar error while running json.dump(). In my case I was getting an error string :
AttributeError: 'file' object has no attribute 'dump'
How I fixed it -
I was using variable name as "json" for File descriptor in the same script, which is why I was getting this error. So I simply renamed that variable name and issue resolved.