python - xkbcommon : ERROR: failed to add default include path

标签 python qt

每当我启动一个尝试访问键盘的 python 脚本时,例如,使用 OpenCV 的 waitKey() 方法,我都会收到以下错误:

Qt: Failed to create XKB context!
Use QT_XKB_CONFIG_ROOT environmental variable to provide an additional search path, add ':' as separator to provide several search paths and/or make sure that XKB configuration data directory contains recent enough contents, to update please see http://cgit.freedesktop.org/xkeyboard-config/ .

此错误在我安装键盘库(或 pynput,我不太确定)时开始出现,并在我卸载它们后持续存在。我没有安装QT。 此外,OpenCV 的 waitKey 和两个安装的库都无法检测到任何关键事件(我怀疑这是连接的),但在我收到错误之前就已经是这种情况了。

我在 Ubuntu 18.04 上运行。

我该如何解决这个问题?

最佳答案

我认为最近的这个问题在这里得到了解决: https://github.com/conda-forge/qt-feedstock/issues/104

我认为解决办法是

export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb

但我不是专家……请有人支持我。

关于python - xkbcommon : ERROR: failed to add default include path,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56353346/

相关文章:

具有等号和空格的 Python 子进程参数

c++ - QT 在 QGraphicsScene 上面显示一个 QWidget

c++ - 如何在 Qt 中使用自定义标题栏 move 窗口

macos - 在 OS X 上,$QTDIR 的正确设置是什么?

python - 仅在 H2 内抓取内容 - BeautifulSoup

Python "strange"输出

Python urlparse : small issue

python - 使用 Python 对 csv 中的列求和

c++ - 如何在 Linux 上创建 .desktop 文件应用程序启动器?

c++ - BlockingQueue 的 QWaitCondition : Destroyed while threads are still waiting