dump() missing 1 required positional argument: 'fp' in python json

Solution 1:

Use json.dumps() instead. json.dump() needs a file object and dump JSON to it.

Solution 2:

It worked when I replaced

json_dump = json.dump(data_set)

by

json_dump = json.dumps(data_set)