问题/报错:qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “/usr/local/lib/python3.6/dist-packages/cv2/qt/plugins” even though it was found.
在安装opencv之后,我又安装了contrib,后来忽然出现上述"xcb"错误。
sudo -H pip3 install opencv-python
sudo -H pip3 install opencv-contrib-python
卸载contrib即可解决:
sudo -H pip3 uninstall opencv-contrib-python
sudo -rm -rf /usr/local/lib/python3.6/dist-packages/~pencv_contrib_python*
卸载后,检查下cv2的版本是否正确:
import cv2; cv2.__version__
。如果有误,重装opencv即可。