import matplotlib.pyplot as p1lt
# define data
x = [1, 2, 3, 4, 5, 6]
y = [3, 7, 14, 19, 15, 11]
# create line plot
p1lt.plot(x, y)
# show line plot
p1lt.show()
Matplotlib支持回溯失败(最近一次调用):文件“C:\Users\G\AppData\Roaming\JetBrains\IdeaIC2022.2\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py”,第25行,DO_IMPORT SUCCESSED=ACTIVATE_FUNC()文件“C:\Users\G\AppData\Roaming\JetBrains\IdeaIC2022.2\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_code_executor.py”,行29,在“matplotlib”中:lambda:Activate_Matplotlib(self.enableGui),文件“C:\Users\G\AppData\Roaming\JetBrains\IdeaIC2022.2\plugins\python-ce\helpers\pydev\pydev_ipython\matplotlibtools.py”,行110,在ACTIVATE_Matplotlib GUI中,Backend=Find_Gui_and_Backend()文件“C:\Users\G\AppData\Roaming\JetBrains\IdeaIC2022.2\plugins\python-ce\helpers\pydev\pydev_ipython\matplotlibtools.py”,行47,在Find_gui_and_Backend Backend=matplotlib.rcParams[‘Backend’]文件“D:\books\programming\python17\lib\site-packages\matplotlib_init_.py”,第677行中,在getitemplt.switch_backend(rcsetup._auto_backend_sentinel)文件“D:\books\programming\python17\lib\site-packages\matplotlib\pyplot.py”,第251行中,Switch_Backend Switch_Backend(候选)文件“D:\books\programming\python17\lib\site-packages\matplotlib\pyplot.py”,在Switch_Backend Canvas_CLASS=Backend_mod.FigureCanvas属性中的第266行错误:部分初始化的模块‘matplotlib.ackends.Backend_MacOSX’没有属性‘FigureCanvas’(很可能是由于循环导入)进程结束,退出代码为0
我在我的PC上使用了以前的matplotlib,我删除并重新安装了python和intelij,现在我有这个错误。
1条答案
按热度按时间iovurdzv1#
同样的问题,不知道怎么解决,但我换成了CONDA环境,问题就解决了。那么为什么不试着使用Conda呢