[BUG] LocalProxy.__init__() got an unexpected keyword argument

When I try to run Anki (from the terminal) I get the following error:

Running with temporary Qt5 compatibility shims.
Run with DISABLE_QT5_COMPAT=1 to confirm compatibility with Qt6.
Traceback (most recent call last):
  File "/usr/bin/anki", line 17, in <module>
    import aqt
  File "/usr/lib/python3.10/site-packages/aqt/__init__.py", line 74, in <module>
    from aqt.main import AnkiQt  # isort:skip
  File "/usr/lib/python3.10/site-packages/aqt/main.py", line 21, in <module>
    import aqt.mediasrv
  File "/usr/lib/python3.10/site-packages/aqt/mediasrv.py", line 18, in <module>
    import flask
  File "/usr/lib/python3.10/site-packages/flask/__init__.py", line 4, in <module>
    from . import json as json
  File "/usr/lib/python3.10/site-packages/flask/json/__init__.py", line 8, in <module>
    from ..globals import current_app
  File "/usr/lib/python3.10/site-packages/flask/globals.py", line 56, in <module>
    app_ctx: "AppContext" = LocalProxy(  # type: ignore[assignment]
TypeError: LocalProxy.__init__() got an unexpected keyword argument 'unbound_message'

Some info:

$ yay -Qs anki                                                           1 ✘
local/anki 2.1.54-2
$ python --version
Python 3.10.7

According to flask API, unbound_message does not exist anymore

This is not an Anki problem per se, but someone else can have it. An Anki solution would be to specify the latest flask version in its dependencies

My solution was installing the latest version of flask using pip:

$ pip install -U flask
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.