[英]import matplotlib.backends.backend_tkagg - ModuleNotFoundError: No module named 'PIL'
[英]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.