你能在ReadTheDocs构建中使用QT而不嘲讽吗



我们的项目使用QT(PySide2qtpy(,并使用sphinx autodoc记录在ReadTheDocs上。到目前为止,我们已经模拟出了大多数依赖项,但在这个特定的案例中,模拟qtpy非常复杂。我希望通过在.readthedocs.ymlcondapython部分安装依赖项来简化。

安装似乎很好,但我在RTD构建的sphinx构建步骤中遇到了一个错误:

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.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
Fatal Python error: Aborted

回溯指向我们代码中的一行:QT_APP = QApplication(sys.argv)

我已经尝试设置QT_DEBUG_PLUGINS=1,它提供了一些我什么都做不到的输出:

...
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/home/docs/checkouts/readthedocs.org/user_builds/invest/conda/395/bin/platforms" ...
loaded library "/home/docs/checkouts/readthedocs.org/user_builds/invest/conda/395/lib/python3.8/site-packages/PySide2/Qt/plugins/platforms/libqeglfs.so"
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-docs'
QFactoryLoader::QFactoryLoader() checking directory path "/home/docs/checkouts/readthedocs.org/user_builds/invest/conda/395/lib/python3.8/site-packages/PySide2/Qt/plugins/egldeviceintegrations" ...
QFactoryLoader::QFactoryLoader() looking at "/home/docs/checkouts/readthedocs.org/user_builds/invest/conda/395/lib/python3.8/site-packages/PySide2/Qt/plugins/egldeviceintegrations/libqeglfs-emu-integration.so"
Found metadata in lib /home/docs/checkouts/readthedocs.org/user_builds/invest/conda/395/lib/python3.8/site-packages/PySide2/Qt/plugins/egldeviceintegrations/libqeglfs-emu-integration.so, metadata=
{
"IID": "org.qt-project.qt.qpa.egl.QEglFSDeviceIntegrationFactoryInterface.5.5",
"MetaData": {
"Keys": [
"eglfs_emu"
]
},
"archreq": 0,
"className": "QEglFSEmulatorIntegrationPlugin",
"debug": false,
"version": 331520
}
...

我尝试通过设置QT_QPA_PLATFORM=eglfs来更改平台插件,这会产生类似的错误:Could not initialize egl display。在谷歌上搜索错误大多会发现与树莓派有关的问题。

发生这种情况是因为运行构建的虚拟机实际上没有显示器吗?有办法解决这个问题吗?

发生这种情况是因为运行构建的虚拟机实际上没有显示器吗?

我想"是的";。错误应该是Qt未能连接到X11显示器。

有办法解决这个问题吗?

您可以尝试在xvfb-run下运行构建脚本。因此,您应该运行xvfb-run,而不是运行foo。这将设置一个无头X11服务器。

相关内容

  • 没有找到相关文章

最新更新