from sqlalchemy import create_engine,Table,String,Float,Column,MetaData
meta = MetaData()
engine = create_engine('sqlite:///college.db',echo = True)
Players = Table('Players',meta,Column('name',String(50)),
Column('Speed',Float))
ins = Players.insert()
ins = Players.insert().values(name = 'Rolnando',Speed = 35.5)
conn = engine.connect()
res = conn.execute(ins)
meta.create_all(engine)
运行代码时,出现错误:
OperationalError: (sqlite3.OperationalError) no such table: Players
[SQL: INSERT INTO "Players" (name, "Speed") VALUES (?, ?)]
[parameters: ('Rolnando', 35.5)]
(Background on this error at: http://sqlalche.me/e/e3q8)
安妮妮能否解释错误的根源以及如何解决?