我正在使用Ubuntu 16.04服务器,并且已经创建了flask应用程序并使用apache_wsgi脚本进行托管。
个别地。
我的python文件如下chatbot = ChatBot(
'Dan',
storage_adapter="chatterbot.storage.SQLStorageAdapter"
)
chatbot.set_trainer(ChatterBotCorpusTrainer)
chatbot.train(`
`"chatterbot.corpus.english.greetings"
)
def chat(text):
response = chatbot.get_response(text)
if response.confidence >= 0.8:
return response
else:
pass
当我单独运行它时,它正在运行,但是当我使用flask应用程序时,它给出了一个错误。
我把错误日志
[client 71.6.232.4:41358] sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file (Background on this error at: http://sqlalche.me/e/e3q8)
最佳答案
我已经找到了解决方案。有两个主要解决方案。
授予文件sudo chomd -R 777 db.sqlite3
的权限
提供apache_wsgi作为当前的ubuntu用户名执行
user = name使用以下reference
关于python-3.x - 当包含由wsgi脚本托管的chatter bot的flask应用程序无法打开数据库文件时发生错误(sqlite3.OperationalError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54215292/