Hi! I’d like to merge to doing spaced repetition w/ Anki and want to import my cards from Mnemosyne 2.9. I tried the following:
Import → select Mnemosyne .db file and got error “Fact has no cards”
Import → select Mnemosyne .cards export, renamed as .zip. Got error: “500: specified file not found in archive”, even w/ a rather simple deck.
Traceback for 1):
Traceback (most recent call last):
File "/home/lucas/.local/share/AnkiProgramFiles/.venv/lib/python3.13/site-packages/anki/foreign_data/mnemosyne.py", line 177, in fact_view
fact_view = self.cards[0].fact_view_id
~~~~~~~~~~^^^
IndexError: list index out of range
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/lucas/.local/share/AnkiProgramFiles/python/cpython-3.13.5-linux-x86_64-gnu/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/lucas/.local/share/AnkiProgramFiles/.venv/lib/python3.13/site-packages/aqt/operations/__init__.py", line 243, in wrapped_op
return self._op(mw.col)
~~~~~~~~^^^^^^^^
File "/home/lucas/.local/share/AnkiProgramFiles/.venv/lib/python3.13/site-packages/aqt/import_export/importing.py", line 107, in <lambda>
op=lambda col: mnemosyne.serialize(path, col.decks.current()["id"]),
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lucas/.local/share/AnkiProgramFiles/.venv/lib/python3.13/site-packages/anki/foreign_data/mnemosyne.py", line 34, in serialize
return gather_data(db, deck_id).serialize()
~~~~~~~~~~~^^^^^^^^^^^^^
File "/home/lucas/.local/share/AnkiProgramFiles/.venv/lib/python3.13/site-packages/anki/foreign_data/mnemosyne.py", line 41, in gather_data
notes = [fact.foreign_note(used_fact_views) for fact in facts.values()]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/lucas/.local/share/AnkiProgramFiles/.venv/lib/python3.13/site-packages/anki/foreign_data/mnemosyne.py", line 166, in foreign_note
fact_view = self.fact_view()
File "/home/lucas/.local/share/AnkiProgramFiles/.venv/lib/python3.13/site-packages/anki/foreign_data/mnemosyne.py", line 179, in fact_view
raise Exception(f"Fact {id} has no cards") from err
Exception: Fact <built-in function id> has no cards
Is there maybe an update needed that can deal w/ Mnemosyne 2.9? Or what can I do to import the cards, including learning data please?
It seems like every Mnemosyne update breaks our ability to import their files. Have you checked the other posts about Mnemosyne imports to see if anything there helps you? Search results for 'mnemosyne order:latest' - Anki Forums
Renaming the file definitely won’t work. The db file is the one you want, and you should leave the file extension as-is.
@NameLessGO I updated it to version 2.11 and tried again. but the .db file is the same, so there was no difference. also exporting a deck from the new version and trying to import it in Anki gave same error.
The export from Mnemosyne is a .cards file but when you rename it to .zip, you can see that it just contains a .xml file (and metadata, and optionally media files) which contains the learning data. or the .db file from Mnemosyne contains learning data as well.
Okay. Thanks for taking a look! We’ll have to see if we can get some developer time to look into this. If they’ve changed their format again, it might require another update on our part.
@lucaseichhorn Have you tried importing the .db file you get from Mnemosyne using File > Save As? I just tested on Mnemosyne 2.11 and that apparently worked. It’s a very simple collection though.
I selected a simple deck and went to File → Save As to save a .db file but it’s the same size as my whole deck, so this seems to save the whole deck. (trying to import that give the same error as above.)
I created a simple deck (no Latex, audio files or images) and it worked.
I sent you a link to the .db file that throws the error.
When juggling the included tags/subsets I managed to partially import the cards but cards were set as “New”, i.e. learning progress was unfortunately not imported.
Can you point out a couple of cards that had that problem? The issue is your file contains some notes without associated cards, which indicates either corruption/bad state in the file, or Anki not importing something correctly. The fix mentioned above will allow the import to proceed when cards are missing, but new ones will be created in their place.
I don’t understand what you mean. What are you referring to as “notes”? From what I understand about Mnemosyne: there are cards (of different types) and tags associated w/ the cards.
What I can see (and don’t understand myself) is 3 cards appear as “untagged” and when I check the box to see all of these “3 untagged cards” in the cards browser, no cards appear. That seems like a bug.
Oh and about the issue that all cards appeared as “New”: that was when I had reshuffled my deck in Mnemosyne and tried to import it in Anki, but the reshuffling actually led to all cards being at stage 0. So I can’t actually make a statement about “cards being set to New” w/ my original deck (w/o reshuffling), as that failed to import.
Correcting all the cloze deletion cards sure was a hassle (regex helped a bit) … but I think that Anki’s definition is actually cleaner. A few cards (<1%) disappeared, but it may actually be due to formatting or card type errors. Will still check which ones.