F:\Deeplearning\Plot\Log.py:7: MatplotlibDeprecationWarning: Support for FigureCanvases without a required_interactive_framework attribute was deprecated in Matplotlib 3.6 and will be removed two minor releases later. plt.plot(x, y, 'r-', linewidt=3) Traceback (most recent call last): File "F:\Deeplearning\Plot\Log.py", line 7, in <module> plt.plot(x, y, 'r-', linewidt=3) File "D:\py\Python3\lib\site-packages\matplotlib\pyplot.py", line 2785, in plot return gca().plot( File "D:\py\Python3\lib\site-packages\matplotlib\pyplot.py", line 2282, in gca return gcf().gca() File "D:\py\Python3\lib\site-packages\matplotlib\pyplot.py", line 879, in gcf return figure() File "D:\py\Python3\lib\site-packages\matplotlib\_api\deprecation.py", line 454, in wrapper return func(*args, **kwargs) File "D:\py\Python3\lib\site-packages\matplotlib\pyplot.py", line 813, in figure manager = new_figure_manager( File "D:\py\Python3\lib\site-packages\matplotlib\pyplot.py", line 382, in new_figure_manager _warn_if_gui_out_of_main_thread() File "D:\py\Python3\lib\site-packages\matplotlib\pyplot.py", line 360, in _warn_if_gui_out_of_main_thread if _get_required_interactive_framework(_get_backend_mod()): File "D:\py\Python3\lib\site-packages\matplotlib\pyplot.py", line 208, in _get_backend_mod switch_backend(rcParams._get("backend")) File "D:\py\Python3\lib\site-packages\matplotlib\pyplot.py", line 331, in switch_backend manager_pyplot_show = vars(manager_class).get("pyplot_show") TypeError: vars() argument must have __dict__ attribute
时间: 2023-07-21 19:24:07 浏览: 199
MATLAB.rar_matlab_matlab c++_site:en.pudn.com
这个错误包含了两个部分。第一部分是 `MatplotlibDeprecationWarning`,这是因为在 Matplotlib 3.6 中,`FigureCanvas` 类需要有一个 `required_interactive_framework` 属性。如果没有这个属性,会发出警告。这个警告在未来版本中会被移除。解决这个警告的方法是更新到 Matplotlib 3.6 或更高版本,或者在创建 `FigureCanvas` 对象时设置 `required_interactive_framework` 属性。
第二部分错误是 `TypeError: vars() argument must have __dict__ attribute`,这是因为 `vars()` 函数的参数必须是有 `__dict__` 属性的对象,但是 `manager_class` 没有这个属性。这个问题可能是由于 Matplotlib 的版本不兼容造成的。建议检查你的代码中使用的 Matplotlib 版本是否与其他库兼容,并更新到最新版本。
阅读全文