远程服务器时Ubuntu报错:qt.qpa.xcb: could not connect to display
- 远程服务器时Ubuntu报错:
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" 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.
- 报错由于远程连接服务器时不能直接回传图形界面导致,比如代码中存在cv.imshow()后报上述错误。不要求回传图像,且不报错的解决方案:注释cv.imshow()相关代码后。
指令输入
sudo vim /etc/profile
添加:
export DISPLAY=:0.0
按esc键,然后:wq退出保存
刷新:
source /etc/profile
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)