You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PyQt5运行时xcb平台插件加载失败的错误求助

PyQt5运行时xcb平台插件加载失败的错误求助

我在网上搜了一堆这个问题的解决办法,但没一个能解决我的问题,已经折腾好长时间了还是搞不定😭。

我遇到的错误信息是这样的:

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.

Available platform plugins are: linuxfb, minimal, offscreen, vnc, webgl, xcb.

我的代码其实就是个用来测试的简单窗口,代码如下:

import sys
from PyQt5.QtWidgets import QApplication, QWidget

app = QApplication(sys.argv)
window = QWidget()
window.setWindowTitle("My First PyQt5 Window")
window.setGeometry(100, 100, 400, 300)
window.show()
sys.exit(app.exec_())

我用的是VSCode,环境就是它默认推荐的标准环境。

有没有大佬能帮忙看看呀,万分感谢!

备注:内容来源于stack exchange,提问作者Will Potts

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.14 08:37:58