Tag Archives: Anki cannot start on Debian Buster

Anki cannot start on Debian Buster [How to Solve]

The default Anki package v2.1.8 in Debian Buster cannot start normally with the following error message.

qt: Could not load the Qt platform plugin "xcb" in "" even though it was found.
qt: 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.
Aborted

This message is not detailed enough to locate the cause of the problem. To make more starting information of Anki printed out, set the environment variable QT_DEBUG_PLUGINS as

export QT_DEBUG_PLUGINS=1

Then, restart Anki and at the end of the error message, it reads as

qt: Got keys from plugin meta data ("xcb")
qt: QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
qt: Cannot load library /home/username/.local/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No such file or directory)
qt: QLibraryPrivate::loadPlugin failed on "/home/username/.local/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so" : "Cannot load library /home/username/.local/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No suchfile or directory)"
qt: Could not load the Qt platform plugin "xcb" in "" even though it was found.
qt: 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.
Aborted

So it is obvious that the shared library libxcb-util.so.1 cannot be found on my system and what has actually been installed is libxcb-util.so.0, which is provided by the package libxcb-util0. Luckily, this problem can be easily solved by creating a symbolic link from libxcb-util.so.0 as below.

cd /usr/lib/x86_64-linux-gnu
sudo ln -sf libxcb-util.so.0 libxcb-util.so.1

Now, Anki can start and work properly.
Unfortuntely, there is still a shortcoming that it does not support the Chinese input method Fcitx. It is said that the input method ibus can be supported, but I refuse to switch to it, since it has another problem which, according to here, makes the first character in the selection list blocked by a black box. Then I suggest you download the newest version of Anki from its official site.