# Python Mastery module 9.9

**URL:** <https://forum.codewithmosh.com/t/python-mastery-module-9-9/4305>\
**Category:** Python\
**Created:** [April 20, 2021, 10:32pm UTC](https://forum.codewithmosh.com/t/python-mastery-module-9-9/4305 "2021-04-20T22:32:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fchepil](https://avatars.discourse-cdn.com/v4/letter/f/f9ae1b/32.png) [@fchepil](https://forum.codewithmosh.com/u/fchepil)\
**Post date:** [April 20, 2021, 10:32pm UTC](https://forum.codewithmosh.com/t/python-mastery-module-9-9/4305/1 "2021-04-20T22:32:19Z")

</div>

Followed Mosh exactly on Windows PC n get attribute Error: ‘str’ object has no attribute ‘values’

 ![161895788135414749830574040802](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/2/20b5340ab4eb1630ee6c1ce4da3517e7baf6b817.jpeg)

I modified code to use print() to try to narrow down cause of error… Believe it has to do with the json.loads() method

---

<div class="post-metadata">

**Author:** ![fchepil](https://avatars.discourse-cdn.com/v4/letter/f/f9ae1b/32.png) [@fchepil](https://forum.codewithmosh.com/u/fchepil)\
**Post date:** [April 21, 2021, 3:41pm UTC](https://forum.codewithmosh.com/t/python-mastery-module-9-9/4305/2 "2021-04-21T15:41:29Z")

</div>

Solved my own problem! Issue had to do with how dictionary was structured!  
I had a key called movies within the movies.json file and this is where the movie sets were nested.  
solution:

movies = json.loads(Path(“movies.json”).read\_text())  
with sqlite3.connect(“movies.db”) as sq\_conn:  
command = “INSERT INTO movies VALUES(?,?,?)”  
for m in movies[‘movies’]:  
sq\_conn.execute(command, tuple(m.values()))
