glutanimate / review-heatmap

Anki add-on to help you keep track of your review activity
https://ankiweb.net/shared/info/1771074083
Other
1.2k stars 89 forks source link

error pop-up when opening anki #140

Closed techvio-dev closed 2 years ago

techvio-dev commented 2 years ago

Problem description

Please describe the issue concisely in here. In case of an error: Walk us through the steps you took to get there. What happened? What did you expect to happen?

Checklist

Please replace the space inside the brackets with an x if the following items apply:

Information about your Anki set-up

Please open Anki, go to Help → About, click on "Copy Debug Info", and paste the result between the backticks below (if the button does not appear you are using an older version of Anki 2.1 and will need to update first):


    Anki 2.1.49 (dc80804a) Python 3.10.1 Qt 5.15.2 PyQt 5.15.6
    Platform: Linux
    Flags: frz=False ao=True sv=3
    Add-ons, last update check: 2021-12-28 12:29:18

    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    Advanced Browser ['874215009', 2021-07-22T22:14, 'None', '']
    Convert Subdecks to Tag Hierarchy ['1172858842', 2020-02-23T23:03, 'None', '']
    Custom Background Image and Gear Icon ['1210908941', 2021-08-20T02:20, 'None', '']
    Hierarchical Tags 2 ['594329229', 2021-03-07T03:25, 'None', '']
    Image Occlusion Enhanced for Anki 21 alpha ['1374772155', 2020-04-28T02:21, 'None', '']
    Review Heatmap ['review_heatmap', 2020-04-30T13:23, 'None', '']
    True Retention ['613684242', 2017-11-19T20:43, 'None', '']

    ===IDs of active AnkiWeb add-ons===
    1172858842 1210908941 1374772155 594329229 613684242 874215009

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

Error message (if any)

If you've received an error message, please copy and paste it between the backticks below:

When loading '⁨Review Heatmap⁩':
⁨Traceback (most recent call last):
  File "/home/techvio/.local/lib/python3.10/site-packages/aqt/addons.py", line 230, in loadAddons
    __import__(addon.dir_name)
  File "/home/techvio/.local/share/Anki2/addons21/review_heatmap/__init__.py", line 124, in <module>
    initializeAddon()
  File "/home/techvio/.local/share/Anki2/addons21/review_heatmap/__init__.py", line 114, in initializeAddon
    from .gui.options import initializeOptions
  File "/home/techvio/.local/share/Anki2/addons21/review_heatmap/gui/options.py", line 44, in <module>
    from ..libaddon.gui.dialog_options import OptionsDialog
  File "/home/techvio/.local/share/Anki2/addons21/review_heatmap/libaddon/gui/dialog_options.py", line 48, in <module>
    from .basic.dialog_mapped import MappedDialog
  File "/home/techvio/.local/share/Anki2/addons21/review_heatmap/libaddon/gui/basic/dialog_mapped.py", line 43, in <module>
    from .dialog_basic import BasicDialog
  File "/home/techvio/.local/share/Anki2/addons21/review_heatmap/libaddon/gui/basic/dialog_basic.py", line 40, in <module>
    from .interface import CommonWidgetInterface
  File "/home/techvio/.local/share/Anki2/addons21/review_heatmap/libaddon/gui/basic/interface.py", line 48, in <module>
    from collections import MutableSequence, MutableSet, MutableMapping
ImportError: cannot import name 'MutableSequence' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
dawnem commented 2 years ago

Try this https://github.com/glutanimate/review-heatmap/issues/137#issuecomment-997179041

markovial commented 2 years ago

I had the same problem. I can see from the info you gave that you are using Anki 2.1.49 (dc80804a) Python 3.10.1. It is a problem that comes up when you upgrade to python 3.10.

To fix :

Open this file :

/home/techvio/.local/share/Anki2/addons21/review_heatmap/libaddon/gui/basic/interface.py

Change the line :

from collections import MutableSequence, MutableSet, MutableMapping

to this line :

from collections.abc import MutableSequence, MutableSet, MutableMapping

Save file , and restart anki.

Basically you need to change collections to collections.abc because as python 3.9 warns us :

DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

glutanimate commented 2 years ago

Hey guys,

Thanks for the report! This should be fixed with v1.0.0 which I just released on AnkiWeb: https://ankiweb.net/shared/info/1771074083 (no need for a manual installation any more, you can just copy the add-on code into Anki as with other add-ons.)

If you run into any issues please do let me know!