在linux服务器上出现问题:qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
注意安装顺序
在虚拟环境下先安装numpy scipy matplotlib三个包 后安装 scikit-learn
!!!!一定一定一定是这个顺序。
- 先进入虚拟环境(你自己的)
source activate 虚拟环境名
- 把scipy、matplotlib、scikit-learn这三个包先删掉。我只是为了以防万一,才把这些全删除。你也可以仅删除scikit-learn。
pip uninstall scikit-learn
pip uninstall matplotlib
pip uninstall scipy
- 再进行重新安装
pip install scipy
pip install matplotlib
pip install scikit-learn
- 最后试验一下
import numpy as np
from matplotlib import pyplot as plt
a = [1,2,3,4,5,6,7,8,9,9]
A = np.array(a)
A = A.reshape(len(A), 1)
plt.plot(A)
完成,我的是这样就可以了,关于这个问题浪费了好久的时间,最后才想起来安装需要有顺序问题。
仅作为本人笔记,心灵脆弱,不喜勿喷。