Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
Chris Freeman
Treehouse Moderator 67,893 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

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 67,893 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.