老师,我也遇到这个问题,我的电脑里装了python和Anaconda,别人说不起冲突,那这个问题该怎么解决

Qt: Untested Windows version 6.2 detected!
Traceback (most recent call last):
  File "E:/PycharmProjects/test/matlib.py", line 7, in <module>
    pl.figure(figsize=(8, 4))
  File "D:\Program Files\Anaconda\lib\site-packages\matplotlib\pyplot.py", line 535, in figure
    **kwargs)
  File "D:\Program Files\Anaconda\lib\site-packages\matplotlib\backends\backend_qt5agg.py", line 44, in new_figure_manager
    return new_figure_manager_given_figure(num, thisFig)
  File "D:\Program Files\Anaconda\lib\site-packages\matplotlib\backends\backend_qt5agg.py", line 51, in new_figure_manager_given_figure
    canvas = FigureCanvasQTAgg(figure)
  File "D:\Program Files\Anaconda\lib\site-packages\matplotlib\backends\backend_qt5agg.py", line 242, in __init__
    super(FigureCanvasQTAgg, self).__init__(figure=figure)
  File "D:\Program Files\Anaconda\lib\site-packages\matplotlib\backends\backend_qt5agg.py", line 66, in __init__
    super(FigureCanvasQTAggBase, self).__init__(figure=figure)
  File "D:\Program Files\Anaconda\lib\site-packages\matplotlib\backends\backend_qt5.py", line 243, in __init__
    super(FigureCanvasQT, self).__init__(figure=figure)
AttributeError: 'figure()' is not a Qt property or a signal

小象老师a

赞同来自:

同学您好,非常感谢您的提问~~根据您给的提示应该是 import matplotlib 上出了问题,1. 如果您添加了 show() (如 fig.show())请在代码中去掉这一句看能否显示图像。 2. 如果您仍然有报错信息,请尝试在 import matplotlib 后面加上 matplotlib.use('TkAgg') 改变 backend,希望对您有帮助~~希望对您有帮助~~

要回复问题请先登录注册