Stvad / CrowdAnki

Plugin for Anki SRS designed to facilitate cooperation on creation of notes and decks.
MIT License
533 stars 44 forks source link

Add-on fails to load on Anki startup #199

Closed conceivably closed 1 year ago

conceivably commented 1 year ago

When starting Anki I get the following error with the add-on enabled.

Anki Version ⁨2.1.65 (141bc18b)⁩ Python 3.11.3 Qt 6.5.1 Pyotr 6.5.1

Error
An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.

When loading '⁨CrowdAnki JSON exportimport Edit history Collaborate on deck creation⁩':
⁨Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/aqt/addons.py", line 246, in loadAddons
__import__(addon.dir_name)
File "/home/foo/.local/share/Anki2/addons21/1788670778/__init__.py", line 5, in <module>
from . import main
File "/home/foo/.local/share/Anki2/addons21/1788670778/main.py", line 8, in <module>
from .anki.hook_vendor import HookVendor
File "/home/foo/.local/share/Anki2/addons21/1788670778/anki/hook_vendor.py", line 13, in <module>
@dataclass
^^^^^^^^^
File "/usr/lib/python3.11/dataclasses.py", line 1223, in dataclass
return wrap(cls)
^^^^^^^^^
File "/usr/lib/python3.11/dataclasses.py", line 1213, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                           File "/usr/lib/python3.11/dataclasses.py", line 958, in _process_class
                           cls_fields.append(_get_field(cls, name, type, kw_only))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                           File "/usr/lib/python3.11/dataclasses.py", line 815, in _get_field
                           raise ValueError(f'mutable default {type(f.default)} for field '
                                                      ValueError: mutable default <class '1788670778.anki.adapters.hook_manager.AnkiHookManager'> for field hook_manager is not allowed: use default_factory                                                      ⁩
conceivably commented 1 year ago

Never mind, with the most current version from GitHub things work fine. Thank you for the great add-on!