ratty-blush•2y ago
Anki-addon not working on Anki 23.12.1 [Linux]
Anki add-on startup fails. Deleting other addons or reinstalling Anki did not fix the issue.



18 Replies
eastern-cyan•2y ago
I think it's gonna be a lot more useful for developers if you send debug info

ratty-blushOP•2y ago
Anki 23.12.1 (1a1d4d54) (ao)
Python 3.9.15 Qt 6.6.1 PyQt 6.6.1
Platform: Linux-6.6.12-200.fc39.x86_64-x86_64-with-glibc2.38
When loading Migaku Anki Add-on:
Traceback (most recent call last):
File "aqt.addons", line 245, in loadAddons
File "/home/primary/.var/app/net.ankiweb.Anki/data/Anki2/addons21/1846879528/init.py", line 16, in <module>
from . import (
File "/home/primary/.var/app/net.ankiweb.Anki/data/Anki2/addons21/1846879528/toolbar/init.py", line 4, in <module>
from .. import menu
File "/home/primary/.var/app/net.ankiweb.Anki/data/Anki2/addons21/1846879528/menu/init.py", line 6, in <module>
from . import (
File "/home/primary/.var/app/net.ankiweb.Anki/data/Anki2/addons21/1846879528/menu/settings_window.py", line 7, in <module>
from ..settings_widgets import SETTINGS_WIDGETS
File "/home/primary/.var/app/net.ankiweb.Anki/data/Anki2/addons21/1846879528/settings_widgets.py", line 5, in <module>
from .tutorial_widgets import (
File "/home/primary/.var/app/net.ankiweb.Anki/data/Anki2/addons21/1846879528/tutorial_widgets.py", line 7, in <module>
from .global_hotkeys import HotkeyConfigWidget, hotkey_handler
File "/home/primary/.var/app/net.ankiweb.Anki/data/Anki2/addons21/1846879528/global_hotkeys/init.py", line 6, in <module>
from .hotkeys import HotkeyHandler
File "/home/primary/.var/app/net.ankiweb.Anki/data/Anki2/addons21/1846879528/global_hotkeys/hotkeys.py", line 3, in <module>
from magicy.keyboard import Key, Controller
File "/home/primary/.var/app/net.ankiweb.Anki/data/Anki2/addons21/1846879528/lib/shared/magicy/init.py", line 42, in <module>
from . import keyboard
File "/home/primary/.var/app/net.ankiweb.Anki/data/Anki2/addons21/1846879528/lib/shared/magicy/keyboard/init.py", line 31, in <module>
backend = backend(name)
File "/home/primary/.var/app/net.ankiweb.Anki/data/Anki2/addons21/1846879528/lib/shared/magicy/_util/init.py", line 78, in backend
raise ImportError(
ImportError: this platform is not supported: ('failed to acquire X connection: Bad display name ""', DisplayNameError(''))
Try one of the following resolutions:
* Please make sure that you have an X server running, and that the DISPLAY environment variable is set correctly
conscious-sapphire•2y ago
Does this help you:
conscious-sapphire•2y ago
Stack Overflow
python pynput ERROR: failed to acquire X connection: Bad display na...
Traceback (most recent call last):
File "/boot/system/key.py", line 1, in <module>
from pynput.keyboard import Key, Listener, Controller
File "/home/user/.local/lib/pyt...
conscious-sapphire•2y ago
@Lyco
eastern-cyan•2y ago
Or if he's running wayland maybe he should install
xorg-xwayland
package
Without it I got the same errorratty-blushOP•2y ago
echo $DISPLAY gives me ':0'
I am running Fedora 39. The addon works when I log in on xorg instead of wayland.
conscious-sapphire•2y ago
Thanks for the input. I'm a Linux noob 🙂
Okay, good to know. We can't really do anything here however, because the issue is upstream in our dependencies
eastern-cyan•2y ago
Do you have xorg-xwayland?
https://src.fedoraproject.org/rpms/xorg-x11-server-Xwayland
ratty-blushOP•2y ago
Yes, this package is installed.
eastern-cyan•2y ago
Does anki use it?
https://askubuntu.com/questions/1393618/how-can-i-tell-if-an-application-is-using-xwayland
Ask Ubuntu
How can I tell if an application is using XWayland?
I'm troubleshooting some issues to do with multiple monitors and HiDPI on Wayland. I've learnt from online resources that applications on XWayland may not handle this use-case as expected. So now I...
eastern-cyan•2y ago
Deleted xwayland > restarted my wm > got an error in anki > installed xwayland> restarted wm > anki works
eastern-cyan•2y ago
ratty-blushOP•2y ago
I checked with xlsclients and Anki does not use xorg-wayland. Removing wayland display variable with env -u works.
eastern-cyan•2y ago
So edit .desktop file then and it should work
ratty-blushOP•2y ago
Thanks for your help. So the solution is to force Anki to use xorg if it does not do it automatically.
eastern-cyan•17mo ago
Yep, that's why we should have xwayland in a first place
Shouldn't it be marked as solved..?
ratty-blushOP•17mo ago
Added the "issue fixed" tag.