qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/root/.local/lib/python3.8/site-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb.
python运行报qt插件错误,导致cv2.imshow("img", img)无法显示,重新装过了opencv ,版本契合我目前的python版本,有关pyqt的插件很多,不知道装哪个 我是连接服务器做的,请问如何解决?
你这个报错实在什么环境下的
不知道你这个问题是否已经解决, 如果还没有解决的话:参考博客
《qt.qpa.xcb: could not connect to display解决方案》,更具体来说,参考链接https://stackoverflow.com/questions/60032540/opencv-cv2-imshow-is-not-working-because-of-the-qt先卸载当前版本opencv-python,再安装较低版本opencv-python==4.1.0.25
pip uninstall opencv-python
pip install opencv-python==4.1.0.25 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
此时,再使用cv2.imshow()
函数,依然会出现报错信息,如下
No protocol specified
: cannnot connect to X server : 0