簡體   English   中英

matplotlib.backends.backend_tkagg 為“blit”引發屬性錯誤

[英]matplotlib.backends.backend_tkagg is throwing an attribute error for 'blit'

當我嘗試在終端上運行python3 module_7.py時,出現以下錯誤:

  File "/opt/CarlaSimulator/PythonClient/live_plotter.py", line 227, in plot_figure
    tkagg.blit(photo, fca.get_renderer()._renderer, colormode=2)
AttributeError: module 'matplotlib.backends.backend_tkagg' has no attribute 'blit'

我檢查了 matplotlib 安裝,一切似乎都很好。 使用 CARLA 模擬器時會出現此問題。 有一些建議的修復,例如在 pyplot 導入之前添加 backend_tkagg 導入,但它沒有解決問題。

似乎 matplotlib 改變了一些東西。 根據文檔,您應該使用tkagg.FigureCanvasTkAgg.blit而不是tkagg.blit (假設您import matplotlib.backends.backend_tkagg as tkagg )。

暫無
暫無

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

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