4

I have json package in my system and have also kept json.py package in same directory where json file is kept. Still I am gitting this error- AttributeError: module 'json' has no attribute 'load'.

code-

import json

# Load JSON: json_data
with open("D:\\python\\Datacamp\\world_bank.json") as json_file:
    json_data = json.loads(json_file)

# Print each key-value pair in json_data
for k in json_data.keys():
    print(k + ': ', [k])
Rohan Bhandari
  • 51
  • 1
  • 1
  • 4

0 Answers0