在ubuntu中安装好spyder后, 打开spyder发现无法输入。
在打开spyder的终端窗口,有如下提示:
QXcbConnection: Failed to initialize XRandr
Qt: XKEYBOARD extension not present on the X server.
Qt: Could not determine keyboard configuration data from X server, will use hard-coded keymap configuration.
Qt: Failed to compile a keymap!
Current XKB configuration data search paths are:
/home/xxx/anaconda3/lib
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/ .
解决方法
到自己的home目录下(~),打开资源配置文件:
cd ~
vim .bashrc
然后在文件末尾添加两行:
export XKB_DEFAULT_RULES=base
export QT_XKB_CONFIG_ROOT="/usr/share/X11/xkb:$QT_XKB_CONFIG_ROOT"
然后重新加载环境:
source .bashrc
打开spyder 问题解决