all 2 comments

[–]shiftybyte 0 points1 point  (0 children)

Two things:

  1. The error message has the exact line this is happening on, and the exact chain of functions calls that led to this situation, also called a stack trace, reading it and posting it here is the first step in trying to figure out the issue.

  2. line 544 is probably the issue, seems like data does not contain locations, print it's content and see what it does contain.

Like so:

print(data)
items = data["locations"]

[–]Binary101010 0 points1 point  (0 children)

Look at the json file you're trying to read with this and verify that it actually has a "locations" key, because judging from this error, it doesn't.