【问题标题】:sudden Qt error when using matplotlib on cmd在 cmd 上使用 matplotlib 时突然出现 Qt 错误
【发布时间】:2020-03-22 00:14:50
【问题描述】:

有一些问题提到了同样的错误信息,但关键的区别在于 我没有(故意)使用 Qt。我实际上并不知道它是什么,并且我试图在 cmd 上运行我的程序,而不是通过任何 IDE。 直到现在我一直在使用 matplotlib 没有任何问题,当我突然收到错误消息时:

This application failed to start because it could not find or load the Qt platform plugin "windows"
in "".
Available platform plugins are: direct2d, minimal, offscreen, windows.
Reinstalling the application may fix this problem. 

这里是一个产生这个错误的示例程序,虽然我怀疑这是使用的包而不是程序的结果

import matplotlib.pyplot as plt

nums = [1,2,3,4]
labels = ["one","two","three","four"]
colours, one, two = plt.pie(nums, labels=labels, autopct='%1.1f%%')
plt.legend(colours, labels, loc="best")
plt.axis('equal')
plt.show()

再次,我几年前安装了 matplotlib,直到现在一直使用它。任何帮助将不胜感激。

编辑:python 3.7.1 版,matplotlib 3.1.1 版

【问题讨论】:

    标签: python windows qt matplotlib


    【解决方案1】:

    好的,我刚刚通过将 matplotlib 升级到 3.2.1 版本来修复它 不知道为什么会这样,但是嘿

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-17
      • 2023-03-27
      • 2021-07-04
      相关资源
      最近更新 更多