![](/img/trans.png)
[英]This application failed to start because it could not find or load the Qt platform plugin "xcb" in ""
[英]Matplotlib gives This application failed to start because it could not find or load the Qt platform plugin “xcb” in “”
以下代碼給出錯誤: Matplotlib 給出此應用程序無法啟動,因為它無法在“”中找到或加載 ZE8801102A40AD89DDCFDCAEBF008D25Z 平台插件“xcb”。
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()
解決方案是安裝 PyQt5 /EnvironmentDirectoryPath/pip3 install PyQt5
。
我還使用sudo apt-get install python-qt4
在系統范圍內安裝了它,沒有任何不良影響。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.