我正在使用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

09-25 18:55