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
Henrik Christensen
Python Web Development Techdegree Student 38,322 Pointssqlite3 students.db problems - need help BIG TIME!
Hi,
I'm doing the "Python Databases" and so far I've done just like Kenneth Love but I'm getting an error in the prompt :-/
Here is my code:
from peewee import *
db = SqliteDatabase("students.db")
class Student(Model):
username = CharField(max_length=255, unique=True)
points = IntegerField(default=0)
class Meta:
database = db
if __name__ == "__main__":
db.connect()
db.create_tables([Student], safe=True)
and inside the prompt I type:
- python students.py
- dir (just to check if the students.db is there)
- sqlite3 students.db
but when I type sqlite3 students.db I get this error message:
- "sqlite3" is not recognized as an internal or external command, operable program or batch file
I have no idea how to fix this and can't seem to find the the solution on google :-/
Am I missing something?
3 Answers
Alexander Davison
65,469 PointsI recommend following along in workspaces, unless you want to install sqlite3. it's fairly easy to upload (at least I think you can upload) code, I think all you need to do is select File > Upload than you can upload your files. It's a good idea to follow along in Workspaces because everything is pre-installed.
This isn't required but if you don't want to do that you can look up how to install sqlite3! :)
~Alex
Henrik Christensen
Python Web Development Techdegree Student 38,322 Pointsnope
james malloy
7,959 PointsHi Henrik, you've probably sorted this by now, but if not, it might be worth checking if sqlite is in your PATH variable (or at least if you're on windows).
Cheers.
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsAre you using Workspaces?