Skip to content

Anki 2.1 addons not working #158388

Description

@little-dude

Describe the bug

I installed this addon https://ankiweb.net/shared/info/1508357010 via the Tools > Addons menu. After restarting anki, a pop-up shows the following message:

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 'Remaining time for Anki 21':
Traceback (most recent call last):
  File "/nix/store/pp2b7f9vkl8912yjx3gsd1z27nrz05mw-anki-2.1.15/lib/python3.9/site-packages/aqt/addons.py", line 80, in loadAddons
    __import__(dir)
  File "/home/little-dude/.local/share/Anki2/addons21/1508357010/__init__.py", line 26, in <module>
    from .utils import debugLog  # debug log registered here
  File "/home/little-dude/.local/share/Anki2/addons21/1508357010/utils/debugLog.py", line 2, in <module>
    from .JSCallable import JSCallable
  File "/home/little-dude/.local/share/Anki2/addons21/1508357010/utils/JSCallable.py", line 1, in <module>
    from aqt import gui_hooks
ImportError: cannot import name 'gui_hooks' from 'aqt' (/nix/store/pp2b7f9vkl8912yjx3gsd1z27nrz05mw-anki-2.1.15/lib/python3.9/site-packages/aqt/__init__.py)

This other plugin fails in a similar fashion: https://ankiweb.net/shared/info/446355629

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 'Automatic Dark Night Mode':
Traceback (most recent call last):
  File "/nix/store/pp2b7f9vkl8912yjx3gsd1z27nrz05mw-anki-2.1.15/lib/python3.9/site-packages/aqt/addons.py", line 80, in loadAddons
    __import__(dir)
  File "/home/little-dude/.local/share/Anki2/addons21/446355629/__init__.py", line 2, in <module>
    from aqt.theme import theme_manager
ModuleNotFoundError: No module named 'aqt.theme'

Steps To Reproduce

  1. install Anki 2.1 with `nix-env -iA nixos.anki
  2. start Anki the "Automatic Dark Night Mode" plugin: click Tools > Addons > Get Add-ons... and enter the code 446355629.
  3. restart Anki, the error message appears and the plugin doesn't work

Expected behavior

No error message when starting Anki, and the plugins work

Notify maintainers

@oxij @Profpatsch

Metadata

nix-shell -p nix-info --run "nix-info -m"
this path will be fetched (0.06 MiB download, 0.30 MiB unpacked):
  /nix/store/nzqp5skqlczar1smnc9rppnv2nxvdlzp-bash-interactive-5.1-p12-dev
copying path '/nix/store/nzqp5skqlczar1smnc9rppnv2nxvdlzp-bash-interactive-5.1-p12-dev' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 5.16.4, NixOS, 22.05 (Quokka)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.6.0`
 - channels(root): `"nixos-22.05pre350838.554d2d8aa25"`
 - channels(little-dude): `"home-manager, nixos-22.05pre337103.581d2d6c9cd"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions