Python

jayda hendrickson
jayda hendrickson
3,413 Points

Databases with peewee ORM

Everytime I type sqlite3 with the name of my database in my command line I'm getting this error: "sqlite3 : The term 'sqlite3' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • sqlite3 diary.db
  • ~~~~~~~
    • CategoryInfo : ObjectNotFound: (sqlite3:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException" Which I don't understand because I thought SQLite itself was already installed in python. I'm not sure if this matters but I am using Visual Studio Code as my IDE. Can someone please tell me what I'm doing wrong???
Megan Amendola
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Megan Amendola
Treehouse Teacher

There are a few extra steps to getting it working locally on windows (compared to mac). Give me a few minutes to test it out on my other computer to remember what those steps are.

2 Answers

Megan Amendola
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Megan Amendola
Treehouse Teacher

I had the same issue when I tried to run this command on my windows computer for the first time during a livestream. I talk about it in this video starting at about 4:20.

I'll also try to this out the steps here as best as I can:

1) Download SQLite - Select Precompiled Binaries for Windows choose either the 32 or 64 bit one.

2) Unzip the folder - it will download as a zip file, so you will need to unzip it.

3) Create a folder on your computer called sqlite - mine is inside of my docmuents

4) Move the unzipped folder you downloaded into this new folder called sqlite

5) Now you need to add this location to PATH - I followed these directions NOTE when you get to the step where he says to click new and type in your location, click browse instead. This way you can navigate to the folder and save it to PATH that way. I think it is a lot easier than trying to remember how to type its location.

6) Restart/reopen the terminal

7) Then you should be able to run sqlite3.exe diary.db to open your db in the sqlite shell