【问题标题】:Matplotlib gives This application failed to start because it could not find or load the Qt platform plugin "xcb" in ""Matplotlib 给出 This application failed to start because it could not find or load the Qt platform plugin "xcb" in ""
【发布时间】:2019-11-09 19:13:39
【问题描述】:

以下代码给出错误: Matplotlib 给出 This application failed to start because it could not find or load the Qt platform plugin "xcb" in "".

import matplotlib.pyplot as plt
import numpy as np


# Create the vectors X and Y
x = np.array(range(100))
y = x ** 2

# Create the plot
plt.plot(x,y)

# Show the plot
plt.show()

【问题讨论】:

  • 您可能缺少某种共享库。你是如何安装 matplotlib 的? QT 安装了吗?

标签: python matplotlib


【解决方案1】:

解决方案是安装 PyQt5 /EnvironmentDirectoryPath/pip3 install PyQt5

https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html#understanding-the-correct-version-to-install找到详细信息

我还在系统范围内使用sudo apt-get install python-qt4 安装了它,没有任何不良影响。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-06
    • 1970-01-01
    • 1970-01-01
    • 2022-12-02
    • 2017-03-29
    • 2022-12-27
    • 1970-01-01
    相关资源
    最近更新 更多