繁体   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