簡體   English   中英

當帶有 wsgi 腳本 [sqlite3.OperationalError) 的帶有聊天機器人的燒瓶應用程序無法打開數據庫文件時出錯]

[英]error when flask app with chatter bot hosted with a wsgi script [sqlite3.OperationalError) unable to open database file]

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

我已經找到了解決方案。 這個問題有兩個主要的解決方案。

  1. 授予文件sudo chomd -R 777 db.sqlite3
  2. 將 apache_wsgi 作為當前 ubuntu 用戶名 user=name 執行,使用以下參考

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM