远程服务器时Ubuntu报错:qt.qpa.xcb: could not connect to display

远程服务器时Ubuntu报错:qt.qpa.xcb: could not connect to display

  1. 远程服务器时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.
  1. 报错由于远程连接服务器时不能直接回传图形界面导致,比如代码中存在cv.imshow()后报上述错误。不要求回传图像,且不报错的解决方案:注释cv.imshow()相关代码后。
    指令输入
sudo vim /etc/profile

添加:

export DISPLAY=:0.0

按esc键,然后:wq退出保存

刷新:

source /etc/profile

你可能感兴趣的:(Jetson,Xavier,NX,系统,qt,ubuntu,开发语言)