Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
492 views
in Technique[技术] by (71.8m points)

python - Why is sqlite3 not being recognized by VSCode?

I am having trouble running sqlite3 in the powershell in VSCode. I already have sqlite3 in my PATH so that is not it. My code is below and seems to be working just fine and it is properly creating the students.db file. However when I go to access it in the terminal I get this.

PS C:UsersDevinDesktopIntermediate Python> sqlite3 students.db

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 students.db
    • CategoryInfo : ObjectNotFound: (sqlite3:String) [], CommandNotFoundE xception
    • FullyQualifiedErrorId : CommandNotFoundException
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)
question from:https://stackoverflow.com/questions/65855474/why-is-sqlite3-not-being-recognized-by-vscode

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

First make sure the path using: $env:psmodulePath. Then use Import-Module to import


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...