Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xkbcommon: ERROR: failed to add default include path

Tags:

python

qt

Whenever I start a python script that tries to access the keyboard, for example, with OpenCV's waitKey() method, I get the following error:

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/ .

This error started to appear when I installed the keyboard library (or pynput, I am not quite sure) and persisted after I uninstalled them. I do not have QT installed. Also, neither OpenCV's waitKey nor the two installed libraries can detect any key events (I suspect this is connected), which was already the case before I got the error though.

I am running on Ubuntu 18.04.

How can I go about this problem?

like image 262
Luca Thiede Avatar asked Mar 01 '26 08:03

Luca Thiede


1 Answers

I think this recent issue was resolved here: https://github.com/conda-forge/qt-feedstock/issues/104

I think the solution is

export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb

but I'm not an expert... somebody back me up here please.

like image 108
user3196617 Avatar answered Mar 03 '26 19:03

user3196617



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!