Python 3.14 not supported

AnkiHub doesn’t support Python 3.14 yet due to using an outdated version of mashumaro. Please update this, thanks.

Anki 25.09.2 (3890e12c) (ao)
Python 3.14.3 Qt 6.10.2 PyQt 6.10.2
Platform: Arch Linux

When loading AnkiHub:
Traceback (most recent call last):
  File "/usr/lib/python3.14/site-packages/aqt/addons.py", line 250, in loadAddons
    __import__(addon.dir_name)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/home/user/.local/share/Anki2/addons21/1322529746/__init__.py", line 28, in <module>
    from . import entry_point
  File "/home/user/.local/share/Anki2/addons21/1322529746/entry_point.py", line 14, in <module>
    from .db import ankihub_db
  File "/home/user/.local/share/Anki2/addons21/1322529746/db/__init__.py", line 1, in <module>
    from .db import (  # noqa: F401
    ...<4 lines>...
    )
  File "/home/user/.local/share/Anki2/addons21/1322529746/db/db.py", line 39, in <module>
    from ..ankihub_client import Field, NoteInfo, suggestion_type_from_str
  File "/home/user/.local/share/Anki2/addons21/1322529746/ankihub_client/__init__.py", line 6, in <module>
    from .ankihub_client import (  # noqa: F401
    ...<10 lines>...
    )
  File "/home/user/.local/share/Anki2/addons21/1322529746/ankihub_client/ankihub_client.py", line 45, in <module>
    from .models import (
    ...<19 lines>...
    )
  File "/home/user/.local/share/Anki2/addons21/1322529746/ankihub_client/models.py", line 55, in <module>
    class NoteInfo(DataClassJSONMixinWithConfig):
    ...<12 lines>...
        )
  File "/home/user/.local/share/Anki2/addons21/1322529746/lib/mashumaro/mixins/dict.py", line 26, in __init_subclass__
    compile_mixin_unpacker(cls, **builder_params["unpacker"])
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/share/Anki2/addons21/1322529746/lib/mashumaro/core/meta/mixin.py", line 49, in compile_mixin_unpacker
    builder.add_unpack_method()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/user/.local/share/Anki2/addons21/1322529746/lib/mashumaro/core/meta/code/builder.py", line 584, in add_unpack_method
    self._add_unpack_method_lines(method_name)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/home/user/.local/share/Anki2/addons21/1322529746/lib/mashumaro/core/meta/code/builder.py", line 489, in _add_unpack_method_lines
    ).build(
      ~~~~~^
        fname=fname,
        ^^^^^^^^^^^^
    ...<2 lines>...
        alias=alias,
        ^^^^^^^^^^^^
    )
    ^
  File "/home/user/.local/share/Anki2/addons21/1322529746/lib/mashumaro/core/meta/code/builder.py", line 1330, in build
    unpacked_value = UnpackerRegistry.get(
        ValueSpec(
    ...<8 lines>...
        )
    )
  File "/home/user/.local/share/Anki2/addons21/1322529746/lib/mashumaro/core/meta/types/common.py", line 225, in get
    raise UnserializableField(
        spec.field_ctx.name, spec.type, spec.builder.cls
    )
mashumaro.exceptions.UnserializableField: Field "tags" of type Optional[List[str]] in NoteInfo is not serializable
Thinking

Search
Found 0 results for ‘tags:official Python 3.14 mashumaro UnserializableField tags Optional[List[str]] NoteInfo AnkiHub category::person_raising_hand: Support order:latest_topic max_posts:5 status:open’

Thanks for reporting this and for including the full traceback + environment details—that’s very helpful.

You’re exactly right: this is an incompatibility between the AnkiHub add-on’s bundled mashumaro version and Python 3.14, which is what’s causing the UnserializableField error for tags: Optional[List[str]] in NoteInfo.

At the moment:

  • The AnkiHub add-on is primarily tested against the official Anki builds, which currently ship with Python 3.9/3.10 (depending on platform and version), not 3.14.
  • Running the add-on on a system-packaged Anki with Python 3.14 (like Arch Linux) is therefore not officially supported yet, and issues like this can occur until we explicitly update and test dependencies such as mashumaro.

What you can do right now

  1. Use the official Anki build (recommended workaround for now)
    Download from https://apps.ankiweb.net and run Anki from that build instead of the Arch package. The AnkiHub add-on should work there without this Python 3.14 issue.

  2. Stay on an older Python/Anki package (if your distro makes that easy)
    Some users pin or downgrade to a distro Anki build that uses an earlier Python until add-ons catch up.

About updating mashumaro

Your request to update mashumaro is totally reasonable, and this is something we’ll need to do (along with testing on newer Python versions) before we can claim compatibility with Python 3.14-based builds. I don’t have the ability to patch the codebase directly from here, but:

  • I’ve noted this as an incompatibility with Python 3.14 / Arch Linux build that will likely require a mashumaro update and possibly code adjustments for the tags: Optional[List[str]] handling.
  • Until that happens, the only reliable way to use AnkiHub on your setup is to switch to the official Anki build or a distro build that uses an older Python version.

If you’re willing, it would also help to mention in the topic whether:

  • Other add-ons are working fine under your Arch build, and
  • Whether this only happens with AnkiHub enabled (i.e., no issues when it’s disabled).

That info can make it easier for the devs to reproduce and prioritize the fix.

Hello,

You are running into a compatibility issue caused by your system’s Python version (3.14.3).

The Anki package in the standard Arch repositories relies on this system-wide Python. The AnkiHub add-on uses a library (mashumaro) that has not yet been updated to support Python 3.14 structure, which is why it’s failing to load.

To fix this, we highly recommend using the official Anki build, which comes bundled with its own isolated, officially supported Python environment.

You can download the official Linux release directly from https://apps.ankiweb.net/.

If you continue to have any problems related to that, please refer to the Anki forums: https://forums.ankiweb.net/

Thank you for your reply. I’d like to keep using the Anki and Python version provided by my distribution. Since the same developer team now maintains both Anki and the AnkiHub add‑on, it’s reasonable to expect the add‑on to work with the same Python versions that Anki supports.

Could you provide guidance on how to upgrade mashumaro on my existing installation? I’m happy to update the libraries locally and test the result on my own system. I appreciate your help.

Yes, it’s definitely a gradual transition, and some things just take a bit of time. Even though Anki and AnkiHub are closely connected, we still use separate support channels depending on the type of issue.

For core technical issues, we highly recommend reaching out on the official Anki forums (Anki - Anki Forums), as you’ll be able to get much better support for specific technical problems there. Unfortunately, I’m not a Linux user myself, so I can’t offer much direct help with this one!

Anki is not officially supported on Python 3.14 yet. The official packages use Python 3.13 and that’s the version Anki maintainers work with on daily basis currently: anki/.python-version at main · ankitects/anki · GitHub

1 Like

Thanks, I didn’t know that only 3.13 is supported. I’m happy to report that Anki itself, plus all of my other extensions, work on 3.14. I was also able to make AnkiHub work on 3.14 with some AI assistance.

Problem

Anki stores addons in directories named by their numeric addon ID (e.g., 1322529746/ ). When Python imports from this directory, the module name becomes 1322529746.ankihub_client.models .

The issue is that mashumaro’s code generator creates type references like typing.List[1322529746.ankihub_client.models.Field] , which is invalid Python syntax because identifiers can’t start with a digit (according to AI).

This is the culprit at lines 340-341 in mashumaro/core/meta/helpers.py:

if short:
    return typ.__qualname__  # type: ignore
else:
    return f"{typ.__module__}.{typ.__qualname__}"  # type: ignore

When short==False , it’s using typ.__module__ directly, which for classes inside the addon is 1322529746.ankihub_client.models (the numeric addon ID is part of the module name).

Workaround

Replace those lines with:

if short:
    return typ.__qualname__  # type: ignore
else:
    module_name = typ.__module__    # Strip numeric addon ID prefix (e.g., "1322529746.ankihub_client" -> "ankihub_client")
    parts = module_name.split(".")
    if parts and parts[0].isdigit():
        module_name = ".".join(parts[1:])
    return f"{module_name}.{typ.__qualname__}"  # type: ignore

Clearly this is not a stable solution because that involves patching the mashumaro library, however I wanted to point this out as a workaround for anyone with the same issue.

1 Like

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