AnkiHub Add on error message

I am currently using Anki Version ⁨24.04.1 (ccd9ca1a)⁩
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1

I have been using the ankihub add


on for a long time, however recently when I open my anki app it reports an error message that the ankihub add on is not working. The “Ankihub” tab is no longer present in the menu on the top of my screen either. I have followed the troubleshoot instructions and those have not worked either. I have also tried to delete and download the add on again, but that still leads to the same error message showing up.

How can I fix this? this has been going on for a while now.

Please click Copy Debug Info and paste the error text here.

Anki 24.04.1 (ccd9ca1a) (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: macOS-11.7.9-x86_64-i386-64bit

Traceback (most recent call last):
File “aqt.progress”, line 119, in handler
File “aqt.mediasync”, line 120, in check_finished
File “aqt.main”, line 656, in after_media_sync
File “aqt.main”, line 534, in callback
File “aqt.main”, line 551, in _unloadProfile
AttributeError: ‘AnkiQt’ object has no attribute ‘_reviewer_refresh_timer’

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
AMBOSS add-on [‘0amboss_addon’, 2023-11-13T12:01, ‘None’, ‘’]
AnkiHub [‘1322529746’, 2024-05-07T11:16, ‘None’, ‘’]
Batch Editing [‘291119185’, 2023-10-25T20:38, ‘None’, ‘’]
Colorful Tags Hierarchical Tags [‘594329229’, 2022-09-15T11:06, ‘None’, ‘’]
Create Filtered Deck from the Browser [‘861263371’, 2017-08-29T14:57, ‘None’, ‘’]
Custom Background Image and Gear Icon [‘1210908941’, 2023-04-18T21:19, ‘None’, mod]
Extended Tag AddEdit Dialog [‘1135507717’, 2023-11-11T11:58, ‘None’, mod]
Image Occlusion Enhanced for Anki 21 [‘1374772155’, 2022-04-09T03:15, ‘None’, ‘’]
Postpone cards review [‘1152543397’, 2023-04-14T22:29, ‘None’, ‘’]
Review Heatmap [‘1771074083’, 2022-07-23T03:34, ‘None’, ‘’]
Special Fields [‘1102281552’, 2024-03-19T19:34, ‘None’, mod]
True Retention [‘613684242’, 2017-11-19T15:43, ‘None’, ‘’]
UWorld to Filtered Decks [‘231059189’, 2023-01-16T16:35, ‘None’, ‘’]
uworld_qid_to_anki_search [‘607963104’, 2023-01-18T16:20, ‘None’, ‘’]

===IDs of active AnkiWeb add-ons===
1102281552 1135507717 1152543397 1210908941 1322529746 1374772155 1771074083 231059189 291119185 594329229 607963104 613684242 861263371

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

This error message usually appears when you close Anki or switch profiles, and is harmless. I’d be surprised if it’s appearing for you on startup.

I still get the error message upon opening. Here is the copied debug info from that message:

Anki 24.04.1 (ccd9ca1a) (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: macOS-11.7.9-x86_64-i386-64bit

Traceback (most recent call last):
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3232, in connect
self._state.set_connection(self._connect())
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3579, in _connect
self._add_conn_hooks(conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3589, in _add_conn_hooks
self._set_pragmas(conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3604, in _set_pragmas
cursor.execute(‘PRAGMA %s = %s;’ % (pragma, value))
sqlite3.DatabaseError: database disk image is malformed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3290, in execute_sql
cursor = self.cursor()
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3280, in cursor
self.connect()
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3235, in connect
self._initialize_connection(self._state.conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3059, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 192, in reraise
raise value.with_traceback(tb)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3232, in connect
self._state.set_connection(self._connect())
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3579, in _connect
self._add_conn_hooks(conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3589, in _add_conn_hooks
self._set_pragmas(conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3604, in _set_pragmas
cursor.execute(‘PRAGMA %s = %s;’ % (pragma, value))
peewee.DatabaseError: database disk image is malformed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “aqt.progress”, line 119, in handler
File “aqt.main”, line 218, in on_window_init
File “aqt.main”, line 317, in setupProfile
File “aqt.main”, line 496, in loadProfile
File “_aqt.hooks”, line 4101, in call
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/entry_point.py”, line 56, in _on_profile_did_open
if not _profile_setup():
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/entry_point.py”, line 84, in _profile_setup
ankihub_db.setup_and_migrate(ankihub_db_path())
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/db/db.py”, line 79, in setup_and_migrate
if self.schema_version() == 0:
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/db/db.py”, line 90, in schema_version
return get_peewee_database().pragma(“user_version”)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3625, in pragma
row = self.execute_sql(sql).fetchone()
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3291, in execute_sql
cursor.execute(sql, params or ())
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3059, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 192, in reraise
raise value.with_traceback(tb)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3290, in execute_sql
cursor = self.cursor()
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3280, in cursor
self.connect()
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3235, in connect
self._initialize_connection(self._state.conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3059, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 192, in reraise
raise value.with_traceback(tb)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3232, in connect
self._state.set_connection(self._connect())
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3579, in _connect
self._add_conn_hooks(conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3589, in _add_conn_hooks
self._set_pragmas(conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3604, in _set_pragmas
cursor.execute(‘PRAGMA %s = %s;’ % (pragma, value))
peewee.DatabaseError: database disk image is malformed

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
AMBOSS add-on [‘0amboss_addon’, 2023-11-13T12:01, ‘None’, ‘’]
AnkiHub [‘1322529746’, 2024-05-07T11:16, ‘None’, ‘’]
Batch Editing [‘291119185’, 2023-10-25T20:38, ‘None’, ‘’]
Colorful Tags Hierarchical Tags [‘594329229’, 2022-09-15T11:06, ‘None’, ‘’]
Create Filtered Deck from the Browser [‘861263371’, 2017-08-29T14:57, ‘None’, ‘’]
Custom Background Image and Gear Icon [‘1210908941’, 2023-04-18T21:19, ‘None’, mod]
Extended Tag AddEdit Dialog [‘1135507717’, 2023-11-11T11:58, ‘None’, mod]
Image Occlusion Enhanced for Anki 21 [‘1374772155’, 2022-04-09T03:15, ‘None’, ‘’]
Postpone cards review [‘1152543397’, 2023-04-14T22:29, ‘None’, ‘’]
Review Heatmap [‘1771074083’, 2022-07-23T03:34, ‘None’, ‘’]
Special Fields [‘1102281552’, 2024-03-19T19:34, ‘None’, mod]
True Retention [‘613684242’, 2017-11-19T15:43, ‘None’, ‘’]
UWorld to Filtered Decks [‘231059189’, 2023-01-16T16:35, ‘None’, ‘’]
uworld_qid_to_anki_search [‘607963104’, 2023-01-18T16:20, ‘None’, ‘’]

===IDs of active AnkiWeb add-ons===
1102281552 1135507717 1152543397 1210908941 1322529746 1374772155 1771074083 231059189 291119185 594329229 607963104 613684242 861263371

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

Try the following steps:

  1. Go to the /Users/devdayal/Library/Application Support/AnkiHub folder. The Library folder is hidden by default, but can be revealed in Finder by holding down the option key while clicking on the Go menu.
  2. Open each subfolder there (you should see at least one with a random name) and delete the ankihub.db file.
  3. Restart Anki

Hi, I tried that but cannot find the AnkiHub folder. This is the latest copy debug info

Anki 24.04.1 (ccd9ca1a) (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: macOS-11.7.9-x86_64-i386-64bit

When loading AnkiHub:
Traceback (most recent call last):
File “aqt.addons”, line 247, in loadAddons
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/init.py”, line 28, in
from . import entry_point
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/entry_point.py”, line 11, in
from .db import ankihub_db
ModuleNotFoundError: No module named ‘1322529746.db’

Did you delete some other files before this error appeared? Please uninstall the add-on and install it again.

If you search for “AnkiHub” in Finder, you should see some folders show up. Check them to find the one with subfolders containing ankihub.db files.

Hi,

I tried searching AnkiHub in Finder and nothing is showing up, I checked every tab in my finder as well and cannot find anything related to AnkiHub. I also reinstalled the add and here is the debug info that shows on opening the app:
Anki 24.04.1 (ccd9ca1a) (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: macOS-11.7.9-x86_64-i386-64bit

Traceback (most recent call last):
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3232, in connect
self._state.set_connection(self._connect())
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3579, in _connect
self._add_conn_hooks(conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3589, in _add_conn_hooks
self._set_pragmas(conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3604, in _set_pragmas
cursor.execute(‘PRAGMA %s = %s;’ % (pragma, value))
sqlite3.DatabaseError: database disk image is malformed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3290, in execute_sql
cursor = self.cursor()
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3280, in cursor
self.connect()
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3235, in connect
self._initialize_connection(self._state.conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3059, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 192, in reraise
raise value.with_traceback(tb)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3232, in connect
self._state.set_connection(self._connect())
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3579, in _connect
self._add_conn_hooks(conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3589, in _add_conn_hooks
self._set_pragmas(conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3604, in _set_pragmas
cursor.execute(‘PRAGMA %s = %s;’ % (pragma, value))
peewee.DatabaseError: database disk image is malformed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “aqt.progress”, line 119, in handler
File “aqt.main”, line 218, in on_window_init
File “aqt.main”, line 317, in setupProfile
File “aqt.main”, line 496, in loadProfile
File “_aqt.hooks”, line 4101, in call
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/entry_point.py”, line 56, in _on_profile_did_open
if not _profile_setup():
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/entry_point.py”, line 84, in _profile_setup
ankihub_db.setup_and_migrate(ankihub_db_path())
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/db/db.py”, line 79, in setup_and_migrate
if self.schema_version() == 0:
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/db/db.py”, line 90, in schema_version
return get_peewee_database().pragma(“user_version”)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3625, in pragma
row = self.execute_sql(sql).fetchone()
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3291, in execute_sql
cursor.execute(sql, params or ())
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3059, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 192, in reraise
raise value.with_traceback(tb)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3290, in execute_sql
cursor = self.cursor()
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3280, in cursor
self.connect()
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3235, in connect
self._initialize_connection(self._state.conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3059, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 192, in reraise
raise value.with_traceback(tb)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3232, in connect
self._state.set_connection(self._connect())
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3579, in _connect
self._add_conn_hooks(conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3589, in _add_conn_hooks
self._set_pragmas(conn)
File “/Users/devdayal/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py”, line 3604, in _set_pragmas
cursor.execute(‘PRAGMA %s = %s;’ % (pragma, value))
peewee.DatabaseError: database disk image is malformed

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
AMBOSS add-on [‘0amboss_addon’, 2023-11-13T12:01, ‘None’, ‘’]
AnkiHub [‘1322529746’, 2024-05-07T11:16, ‘None’, ‘’]
Batch Editing [‘291119185’, 2023-10-25T20:38, ‘None’, ‘’]
Colorful Tags Hierarchical Tags [‘594329229’, 2022-09-15T11:06, ‘None’, ‘’]
Create Filtered Deck from the Browser [‘861263371’, 2017-08-29T14:57, ‘None’, ‘’]
Custom Background Image and Gear Icon [‘1210908941’, 2023-04-18T21:19, ‘None’, mod]
Extended Tag AddEdit Dialog [‘1135507717’, 2023-11-11T11:58, ‘None’, mod]
Image Occlusion Enhanced for Anki 21 [‘1374772155’, 2022-04-09T03:15, ‘None’, ‘’]
Postpone cards review [‘1152543397’, 2023-04-14T22:29, ‘None’, ‘’]
Review Heatmap [‘1771074083’, 2022-07-23T03:34, ‘None’, ‘’]
Special Fields [‘1102281552’, 2024-03-19T19:34, ‘None’, mod]
True Retention [‘613684242’, 2017-11-19T15:43, ‘None’, ‘’]
UWorld to Filtered Decks [‘231059189’, 2023-01-16T16:35, ‘None’, ‘’]
uworld_qid_to_anki_search [‘607963104’, 2023-01-18T16:20, ‘None’, ‘’]

===IDs of active AnkiWeb add-ons===
1102281552 1135507717 1152543397 1210908941 1322529746 1374772155 1771074083 231059189 291119185 594329229 607963104 613684242 861263371

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

Very weird.

Can you open the debug console, run this code and post the output?

from ankihub.settings import ankihub_db_path

pp(ankihub_db_path())

I thought Ankihub is still not updated for Anki 24.04 release (on Arch linux)
Is it updated? I also have error!
I also deleted Ankihub addon folder manually and reinstalled but still error

Anki 24.04.1 (ccd9ca1a) (src) (ao)
Python 3.12.3 Qt 6.7.0 PyQt 6.7.0
Platform: Linux-6.8.9-arch1-2-x86_64-with-glibc2.39

When loading AnkiHub:
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/aqt/addons.py", line 247, in loadAddons
    __import__(addon.dir_name)
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/__init__.py", line 28, in <module>
    from . import entry_point
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/entry_point.py", line 11, in <module>
    from .db import ankihub_db
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/db/__init__.py", line 1, in <module>
    from .db import ankihub_db, execute_list_query_in_chunks, flat  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/db/db.py", line 38, in <module>
    from ..ankihub_client import Field, NoteInfo, suggestion_type_from_str
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/ankihub_client/__init__.py", line 6, in <module>
    from .ankihub_client import (  # noqa: F401
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/ankihub_client/ankihub_client.py", line 44, in <module>
    from .models import (
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/ankihub_client/models.py", line 14, in <module>
    from mashumaro.mixins.json import DataClassJSONMixin
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/lib/mashumaro/mixins/json.py", line 14, in <module>
    class DataClassJSONMixin(DataClassDictMixin):
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/lib/mashumaro/mixins/dict.py", line 21, in __init_subclass__
    compile_mixin_unpacker(cls, **builder_params["unpacker"])
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/lib/mashumaro/core/meta/mixin.py", line 44, in compile_mixin_unpacker
    builder.add_unpack_method()
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/lib/mashumaro/core/meta/builder.py", line 453, in add_unpack_method
    self._add_unpack_method_lines(method_name)
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/lib/mashumaro/core/meta/builder.py", line 342, in _add_unpack_method_lines
    pre_deserialize = self.get_declared_hook(__PRE_DESERIALIZE__)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/lib/mashumaro/core/meta/builder.py", line 309, in get_declared_hook
    if not is_dataclass_dict_mixin(cls):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/lib/mashumaro/core/meta/helpers.py", line 367, in is_dataclass_dict_mixin
    return type_name(t) == DataClassDictMixinPath
           ^^^^^^^^^^^^
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/lib/mashumaro/core/meta/helpers.py", line 150, in type_name
    elif is_generic(t) and not is_type_origin:
         ^^^^^^^^^^^^^
  File "/home/best8oy/.local/share/Anki2/addons21/1322529746/lib/mashumaro/core/meta/helpers.py", line 223, in is_generic
    raise NotImplementedError
NotImplementedError


Output of the code you requested

>>> from ankihub.settings import ankihub_db_path
... 
... pp(ankihub_db_path())
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/aqt/debug_console.py", line 294, in onDebugRet
    exec(text, vars)
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'ankihub'

I also deleted /.local/share/AnkiHub folder but no luck

Hey, I ran the code. Here is the output:

from ankihub.settings import ankihub_db_path

… pp(ankihub_db_path())
Traceback (most recent call last):
File “aqt.debug_console”, line 294, in onDebugRet
File “”, line 1, in
ModuleNotFoundError: No module named ‘ankihub’

@ddayal1211

Sorry, the code I posted doesn’t work for most installations. Try this instead:

from importlib import import_module

def find_addon_by_name(addon_name):
    for name in mw.addonManager.allAddons():
        if mw.addonManager.addonName(name) == addon_name:
            try:
                return import_module(name)
            except ModuleNotFoundError:
                pass

    return None

ankihub = find_addon_by_name("AnkiHub")
print(ankihub.settings.ankihub_db_path())

It should print the path to the ankihub.db file that’s causing the issue. Please locate it and try deleting it.

@BEST8OY Your issue appears to be different. Please post the error in a new thread and I’ll have a look.

Hi here is the new output:

from importlib import import_module

… def find_addon_by_name(addon_name):
… for name in mw.addonManager.allAddons():
… if mw.addonManager.addonName(name) == addon_name:
… try:
… return import_module(name)
… except ModuleNotFoundError:
… pass

… return None

… ankihub = find_addon_by_name(“AnkiHub”)
… print(ankihub.settings.ankihub_db_path())
/Users/devdayal/Library/Application Support/AnkiHub/4dbec789-e802-4e76-a92f-f9a531eace35/ankihub.db

Close Anki then go to the /Users/devdayal/Library/Application Support/AnkiHub/4dbec789-e802-4e76-a92f-f9a531eace35 folder and delete it. You’ll have to log in again to your AnkiHub account after that.

Hi,
When I go into my finder then go to users/devdayal there is no option to go to library. I still do not see any AnkiHub folders anywhere in my finder.

It worked! I was unable to manually locate the file by going into my finder. However, using the spotlight search menu on my Mac I pasted “/Users/devdayal/Library/Application Support/AnkiHub/4dbec789-e802-4e76-a92f-f9a531eace35” in the search bar and was able to find the file and delete it. AnkiHub worked upon opening the application.

Thank you for your help.

1 Like

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