欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

This application failed to start because it could not find or load the Qt platform plugin "xcb".

程序员文章站 2022-03-31 09:38:20
...

anaconda4.2+python3.5下输入如下代码
import matplotlib.pyplot as plt
import numpy as np
x = np.array([0, 1])
plt.scatter(x, x)
plt.show()

报错:
This application failed to start because it could not find or load the Qt platform plugin “xcb”.
Reinstalling the application may fix this problem.
Aborted

解决方案:

conda remove qt
conda remove pyqt
conda install qt
conda install pyqt

如果提示conda权限不够,执行如下代码

sudo chown -R your_user_name <your path>/anaconda3

例如sudo chown -R sloan /home/sloan/anaconda3