![qt.qpa.plugin:无法在“”中加载 Qt 平台插件“xcb”,即使找到了它](https://linux22.com/image/1020507/qt.qpa.plugin%EF%BC%9A%E6%97%A0%E6%B3%95%E5%9C%A8%E2%80%9C%E2%80%9D%E4%B8%AD%E5%8A%A0%E8%BD%BD%20Qt%20%E5%B9%B3%E5%8F%B0%E6%8F%92%E4%BB%B6%E2%80%9Cxcb%E2%80%9D%EF%BC%8C%E5%8D%B3%E4%BD%BF%E6%89%BE%E5%88%B0%E4%BA%86%E5%AE%83.png)
我正在尝试使用适用于 Linux 的 Windows 子系统的 Mobaxterm 在 gnuplot 上绘制某些内容。我安装了 QT 包和 gnuplot 等,并能够成功绘制我想要的内容。在我关闭 PC 并于第二天重新打开以绘制同一张图表后,我收到此错误
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/gnuplot/platforms" ... loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so" qt.qpa.xcb: could not connect to display via:0 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
问题。
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
导出 QT_DEBUG_PLUGINS=1然后显示
> > Got keys from plugin meta data ("minimalegl") QFactoryLoader::QFactoryLoader() looking at
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so"
> Found metadata in lib
> /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so,
> metadata= {
> "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
> "MetaData": {
> "Keys": [
> "offscreen"
> ]
> },
> "archreq": 0,
> "className": "QOffscreenIntegrationPlugin",
> "debug": false,
> "version": 330752 }
>
>
> Got keys from plugin meta data ("offscreen")
> QFactoryLoader::QFactoryLoader() looking at
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so" Found
> metadata in lib
> /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so, metadata=
> {
> "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
> "MetaData": {
> "Keys": [
> "vnc"
> ]
> },
> "archreq": 0,
> "className": "QVncIntegrationPlugin",
> "debug": false,
> "version": 330752 }
>
>
> Got keys from plugin meta data ("vnc")
> QFactoryLoader::QFactoryLoader() looking at
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so" Found
> metadata in lib
> /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so, metadata=
> {
> "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
> "MetaData": {
> "Keys": [
> "xcb"
> ]
> },
> "archreq": 0,
> "className": "QXcbIntegrationPlugin",
> "debug": false,
> "version": 330752 }
>
>
> Got keys from plugin meta data ("xcb")
> QFactoryLoader::QFactoryLoader() checking directory path
> "/usr/lib/gnuplot/platforms" ... loaded library
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
> qt.qpa.xcb: could not connect to display via:0 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: eglfs, linuxfb, minimal, minimalegl,
> offscreen, vnc, xcb.
>
> Could not connect to existing gnuplot_qt. Starting a new one.
> QFactoryLoader::QFactoryLoader() checking directory path
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" ...
> QFactoryLoader::QFactoryLoader() looking at
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so" Found
> metadata in lib
> /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so,
> metadata= {
> "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
> "MetaData": {
> "Keys": [
> "eglfs"
> ]
> },
> "archreq": 0,
> "className": "QEglFSIntegrationPlugin",
> "debug": false,
> "version": 330752 }
>
>
> Got keys from plugin meta data ("eglfs")
> QFactoryLoader::QFactoryLoader() looking at
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so" Found
> metadata in lib
> /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so,
> metadata= {
> "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
> "MetaData": {
> "Keys": [
> "linuxfb"
> ]
> },
> "archreq": 0,
> "className": "QLinuxFbIntegrationPlugin",
> "debug": false,
> "version": 330752 }
>
>
> Got keys from plugin meta data ("linuxfb")
> QFactoryLoader::QFactoryLoader() looking at
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so" Found
> metadata in lib
> /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so,
> metadata= {
> "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
> "MetaData": {
> "Keys": [
> "minimal"
> ]
> },
> "archreq": 0,
> "className": "QMinimalIntegrationPlugin",
> "debug": false,
> "version": 330752 }
>
>
> Got keys from plugin meta data ("minimal")
> QFactoryLoader::QFactoryLoader() looking at
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so"
> Found metadata in lib
> /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so,
> metadata= {
> "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
> "MetaData": {
> "Keys": [
> "minimalegl"
> ]
> },
> "archreq": 0,
> "className": "QMinimalEglIntegrationPlugin",
> "debug": false,
> "version": 330752 }
>
>
> Got keys from plugin meta data ("minimalegl")
> QFactoryLoader::QFactoryLoader() looking at
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so"
> Found metadata in lib
> /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so,
> metadata= {
> "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
> "MetaData": {
> "Keys": [
> "offscreen"
> ]
> },
> "archreq": 0,
> "className": "QOffscreenIntegrationPlugin",
> "debug": false,
> "version": 330752 }
>
>
> Got keys from plugin meta data ("offscreen")
> QFactoryLoader::QFactoryLoader() looking at
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so" Found
> metadata in lib
> /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so, metadata=
> {
> "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
> "MetaData": {
> "Keys": [
> "vnc"
> ]
> },
> "archreq": 0,
> "className": "QVncIntegrationPlugin",
> "debug": false,
> "version": 330752 }
>
>
> Got keys from plugin meta data ("vnc")
> QFactoryLoader::QFactoryLoader() looking at
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so" Found
> metadata in lib
> /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so, metadata=
> {
> "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
> "MetaData": {
> "Keys": [
> "xcb"
> ]
> },
> "archreq": 0,
> "className": "QXcbIntegrationPlugin",
> "debug": false,
> "version": 330752 }
>
>
> Got keys from plugin meta data ("xcb")
> QFactoryLoader::QFactoryLoader() checking directory path
> "/usr/lib/gnuplot/platforms" ... loaded library
> "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
> qt.qpa.xcb: could not connect to display via:0 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: eglfs, linuxfb, minimal, minimalegl,
> offscreen, vnc, xcb.
我尝试过该论坛提供的许多方法,但都没有任何帮助。
谁能告诉我该怎么做才能解决这个问题?
谢谢