- 以服务器作为远程解释器,本地
pycharm或vscode调试时出现如下错误:
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/xx/anaconda3/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, eglfs, minimal, minimalegl, offscreen, vnc
这和IDE不能直接回传图形界面相关,比如一份代码中添加
cv.imshow()后报上述错误
- 解决办法
可借助第三方ssh软件
以windows和pycharm为例,安装远程ssh软件MobaXterm(或其他支持图形回传的远程软件)
输入下面命令

本文介绍了解决在远程服务器上使用PyCharm或VSCode进行Python开发时遇到的图形界面显示问题的方法。通过配置DISPLAY变量及安装相关软件,使得在远程环境中能够正确显示如cv.imshow()等图像。
最低0.47元/天 解锁文章
3251

被折叠的 条评论
为什么被折叠?



