Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Flask with SQLAlchemy Basics Connecting to a Database with SQLAlchemy Creating Pets

Installing sqlite

I may have missed it, but is there a video tutorial for installing sqlite? I'm looking outside treehouse and not being successful. Any guidance would be appreciated. Thank you.

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

If using sqlite3 within Python, it is already part of the installed library.

$ python
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.31.1'

For python documentation, see sqlite3

Post back if you have more questions. Good luck!!

This is what I get when I try to access my database using sqlite3.exe pets.db in the terminal as she does in the video:

The term 'sqlite3.exe' 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.exe pets.db
  • ~~~~~~~~~~~
    • CategoryInfo : ObjectNotFound: (sqlite3.exe:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

Do you know what this means?

Chris Freeman
Chris Freeman
Treehouse Moderator 68,457 Points

It seems that sqlite3.exe is not on your path. As a temporary fix, perhaps you need something like:

$env:PATH += ';G:\SQLite3'

where the path is the directory where sqlite3.exe is installed.

For a more permanent fix, add the directory to your System Property Environment Variables.