Anki crashes on arch linux

since a couple of days ago, anki crashes at startup on arch.
I suspect it might have something to do with a new python version?

~ ➜ anki
Traceback (most recent call last):
  File "/usr/bin/anki", line 16, in <module>
    import aqt
  File "/usr/lib/python3.9/site-packages/aqt/__init__.py", line 39, in <module>
    from aqt.main import AnkiQt  # isort:skip
  File "/usr/lib/python3.9/site-packages/aqt/main.py", line 33, in <module>
    import aqt.mediasrv
  File "/usr/lib/python3.9/site-packages/aqt/mediasrv.py", line 16, in <module>
    import flask
  File "/usr/lib/python3.9/site-packages/flask/__init__.py", line 6, in <module>
    from . import json as json
  File "/usr/lib/python3.9/site-packages/flask/json/__init__.py", line 8, in <module>
    from jinja2.utils import htmlsafe_json_dumps as _jinja_htmlsafe_dumps
ImportError: cannot import name 'htmlsafe_json_dumps' from 'jinja2.utils' (/usr/lib/python3.9/site-packages/jinja2/utils.py)
~ ➜ python --version
Python 3.9.5

I tried both using the version in the arch repos and the git version from the aur

Try version tar.bz2 from Anki website without installation. I use it on Manjaro. On my system python has version 3.9.5-1.

When using that, the program does not crash, but does not open a window either.

/tmp/anki/anki-2.1.44-linux ➜ anki --verbose
Qt warning: No decoration plugins available. Running with no decorations.
Qt warning: No shell integration named "xdg-shell" found
Qt warning: No shell integration named "xdg-shell-v6" found
Qt warning: No shell integration named "wl-shell" found
Qt warning: No shell integration named "ivi-shell" found
Qt warning: Loading shell integration failed.
Qt warning: Attempted to load the following shells ("xdg-shell", "xdg-shell-v6", "wl-shell", "ivi-shell")
Qt warning: Wayland does not support QWindow::requestActivate()
Qt warning: Wayland does not support QWindow::requestActivate()

I am using sway version 1.6

Did you uninstalled version from Arch repositories first?
Looks like you use Wayland, I don’t. Maybe that is what makes a difference.

Read this:

"Qt warning: Wayland does not support QWindow::requestActivate()"
Googling for this shows that other programs also have this problem.

1 Like

Thanks for the reply, forcing the use of X11 resolves the issue.
I did uninstall the other version first.

Qt warning: Wayland does not support QWindow::requestActivate()

This warning has always been there even when it still worked a few weeks ago.
Pasting pictures does currently not work due to xwayland but that might be an issue on my end.
But feel free to close the issue if you native wayland is not officially supported