TShopping

 找回密碼
 註冊
搜索
查看: 531|回復: 0
打印 上一主題 下一主題

[教學] UserWarning: Matplotlib is currently using agg 出現錯誤

[複製鏈接]
跳轉到指定樓層
1#
發表於 2023-7-13 22:55:18 | 只看該作者 |只看大圖 回帖獎勵 |倒序瀏覽 |閱讀模式
 
Push to Facebook
執行PYTHON時,出現錯誤
  1. UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure
複製代碼


或是出現這錯誤訊息
  1. AttributeError: module 'backend_interagg' has no attribute 'FigureCanvas'. Did you mean: 'FigureCanvasAgg'?
複製代碼


解決方法


  1. import matplotlib #加入這兩行
  2. matplotlib.use('TkAgg') #加入這兩行
  3. import matplotlib.pyplot as plt
複製代碼


 

臉書網友討論
*滑块验证:
您需要登錄後才可以回帖 登錄 | 註冊 |

本版積分規則



Archiver|手機版|小黑屋|免責聲明|TShopping

GMT+8, 2024-4-28 06:40 , Processed in 0.071060 second(s), 25 queries .

本論壇言論純屬發表者個人意見,與 TShopping綜合論壇 立場無關 如有意見侵犯了您的權益 請寫信聯絡我們。

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表