NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.13k forks source link

Anki 2.1 addons not working #158388

Closed little-dude closed 8 months ago

little-dude commented 2 years ago

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`
euank commented 1 year ago

The "remaining time" addon works for me with the anki version on master, from this update over here: #221229

Want to check if all the addons you care about work now, with that version?

patka-123 commented 11 months ago

Hello @little-dude :wave:

I tried to reproduce your error, but failed to do so. Is this still an issue you experience, or is it fixed? If so, would you be able to close this issue?

patka-123 commented 8 months ago

I'm going to take the leap and guess that this has been fixed by now. If this was a mistake then please feel free to reopen this issue!