python - 你可以在没有模拟的情况下在 ReadTheDocs 构建中使用 QT 吗?
问题描述
我们的项目使用 QT ( PySide2
, qtpy
) 并使用 sphinx autodoc 记录在 ReadTheDocs 上。到目前为止,我们已经模拟了大多数依赖项,但在这种特定情况下,模拟qtpy
非常复杂。我希望conda
通过python
在.readthedocs.yml
.
安装似乎工作正常,但我在 RTD 构建的 sphinx-build 步骤中遇到错误:
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
:谷歌搜索错误主要是与 Raspberry Pi 相关的问题。
发生这种情况是因为运行构建的虚拟机实际上没有显示器吗?有没有办法解决?
解决方案
发生这种情况是因为运行构建的虚拟机实际上没有显示器吗?
我猜“是”。错误应该是Qt连接X11显示器失败。
有没有办法解决?
您可以尝试在xvfb-run
. 因此,foo
您将运行而不是运行xvfb-run
。这将设置一个无头 X11 服务器。
推荐阅读
- ssh - 查找:在 SSH 命令中缺少 `-exec' 的参数
- c# - 如何修复访问被拒绝路径错误asp.net应用程序访问网络共享
- aurelia - Aurelia I18N:扫描 html 源以获取新密钥并更新 translation.json 文件
- pandas - Pandas 获取按其他列值分组的列值顺序
- vue.js - 在帖子的 v-for 循环中使用 v-model 添加评论
- java - 将参数传递给 gradle 构建脚本
- php - 不按应有的方式将数据插入数据库
- python - 是否可以使用 NumPy 或 Python 中的其他包获得保留的特殊数量的双精度二进制浮点数
- java - 来自 java 的存储过程调用抛出“游标状态无效”错误
- jquery - jQuery File Upload blueimpl 浏览器冻结