Anki Forums

2.1.28beta1 import issue with Special Fields add-on

In the 2.1.28beta1 I get the following error when trying to import a deck with the special fields add-on turned on. You mentioned previously that you’d like me to report things like this in case it’s easier to fix Anki instead of the add-on. Let me know what you’d like for me to do in this case:

Import failed. Debugging info:
Traceback (most recent call last):
File “aqt/importing.py”, line 403, in on_done
File “concurrent/futures/_base.py”, line 432, in result
File “concurrent/futures/_base.py”, line 388, in __get_result
File “concurrent/futures/thread.py”, line 57, in run
File “anki/importing/apkg.py”, line 44, in run
File “anki/importing/anki2.py”, line 41, in run
File “anki/importing/anki2.py”, line 64, in _import
File “/Users/Nick/Library/Application Support/Anki2/addons21/1102281552/init.py”, line 207, in newImportNotes
for importedDid, importedDeck in self.src.decks.decks.copy().items():
AttributeError: ‘DecksDictProxy’ object has no attribute ‘copy’

Not tested, but the code should be updated to be

for importedDid, importedDeck in ((d["id"], d) for d in self.src.decks.all()):

That should work on older Anki versions as well.

2 Likes

Looks like that worked great. Thanks @dae as always

1 Like

I am having the same issue while trying to update my deck to the V7 overhaul. What do I need to do with this code to resolve this? Thank you in advance for your help!

This is the error I keep getting. I am also running 2.1.19 Anki version. Thank you!

Import failed. Debugging info:
Traceback (most recent call last):
File “aqt/importing.py”, line 404, in on_done
File “concurrent/futures/_base.py”, line 432, in result
File “concurrent/futures/_base.py”, line 388, in __get_result
File “concurrent/futures/thread.py”, line 57, in run
File “anki/importing/apkg.py”, line 44, in run
File “anki/importing/anki2.py”, line 41, in run
File “anki/importing/anki2.py”, line 64, in _import
File “/Users/jarrett/Library/Application Support/Anki2/addons21/880042638/init.py”, line 249, in newImportNotes
b = json.loads(models)
File “json/init.py”, line 357, in loads
File “json/decoder.py”, line 337, in decode
File “json/decoder.py”, line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

1 Like

While the error message is the same, in this case it’s the add-on that needs updating - you may want to try checking for updates or removing and re-adding it.