第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

斷言失?。哼\行腳本后 Flask 服務器停止

斷言失敗:運行腳本后 Flask 服務器停止

守著一只汪 2021-09-11 10:17:06
我有一個燒瓶應用程序,當用戶單擊索引頁面上的按鈕時,它們會觸發(fā)生成報告,并使用 send_file() 函數(shù)將其下載到瀏覽器中。每次創(chuàng)建和下載報告時,服務器都會停止,我在終端中收到以下錯誤。每次都需要重新啟動,我不知道如何修復它。有任何想法嗎?:)flask_app.py 文件:from flask import Flask, render_template, request, url_for, flashimport create_reportfrom flask_debugtoolbar import DebugToolbarExtensionfrom flask import send_fileapp = Flask(__name__)filename = ""@app.route("/")def index():    return render_template("index.html")@app.route("/handle_data", methods=['GET', 'POST'])def handle_data():    text = request.form['accountinput']    preprocessed_text = text.lower()    filename = create_report.start_script(preprocessed_text)    path = "reports/" + filename    return send_file(path, as_attachment=True)if __name__ == '__main__':    app.run(debug=True)終端錯誤:Assertion failed: (NSViewIsCurrentlyBuildingLayerTreeForDisplay() != currentlyBuildingLayerTree), function NSViewSetCurrentlyBuildingLayerTreeForDisplay, file /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1561.60.100/AppKit.subproj/NSView.m, line 14485.
查看完整描述

1 回答

?
縹緲止盈

TA貢獻2041條經(jīng)驗 獲得超4個贊

你應該開始你的程序


import matplotlib

matplotlib.use('Agg')

由于create_report模塊使用matplotlib,而對于matplotlib 這是一個常見的情況。


查看完整回答
反對 回復 2021-09-11
  • 1 回答
  • 0 關(guān)注
  • 234 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號