json.loads should accept a json string instead of the filename. In your case you need json.load with an opened file handle
json.loads
json.load
with open('test.json', 'r') as f: data = json.load(f)
Read the docs here: https://docs.python.org/3.8/library/json.html#json.loads
2.1m questions
2.1m answers
60 comments
57.0k users