1
我在我的遠程Ubuntu服務器上開發flask項目。我也使用SQLAlchemy
。但是,當我嘗試運行此腳本時,出現sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
錯誤。SQLAlchemy sqlite3.operational錯誤
這是我models.py
import sys
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
Base = declarative_base()
class Puppy(Base):
__tablename__ = 'puppy'
name =Column(String(80), nullable = False)
id = Column(Integer, primary_key = True)
description = Column(String(250))
@property
def serialize(self):
"""Return object data in easily serializeable format"""
return {
'id': self.id,
'name': self.name,
'description' : self.description
}
engine = create_engine('sqlite:///puppies.db')
Base.metadata.create_all(engine)
我跟着Udacity fullstack網絡基礎教程,它的工作我的本地機器上。但是,我無法在服務器上處理它
我遇到同樣的問題。你有沒有解決它? – Layne
@Layne Nope。找不到解決方案 – Alparslan