mikeizbicki / cmc-csci040

Computing for the Web
37 stars 58 forks source link

sqlite3.OperationalError Problem #230

Closed wgalbreath closed 2 years ago

wgalbreath commented 2 years ago

Hi Mike,

I am experiencing this sqlite3.OperationalError in my project.py file that just started happening yesterday (even though my website/code was running fine the previous few days). I don't think I changed anything about my code that might've caused it.

Screen Shot 2021-12-16 at 10 32 24 AM Screen Shot 2021-12-16 at 10 43 35 AM

I am not sure if I should just fix this with a try / except clause but wanted to see your thoughts since we did not have to do that in class. This error has also shown up on the other lines with cur.execute(sql). Please let me know what you think!

Thank you for your help! William

mikeizbicki commented 2 years ago

The no such table: users line indicates that there has never been a CREATE TABLE users command run on this database file. This would happen if you are loading an empty database file that was not created with db_create.py. The most likely cause of this problem is that your paths are messed up, and you need to cd into the right folder before running your python commands.