patarapolw/ankisync2

ImportError: cannot import name 'db' from 'ankisync2.apkg'

TT-392 opened this issue · 2 comments

I am not sure what is going on here (I am not the greatest with python stuff). I installed ankysinc2, like in the README: pip install ankisync2, and ran the first example. There I got an ImportError: cannot import name 'db' from 'ankisync2.apkg' (/home/username/.local/lib/python3.9/site-packages/ankisync2/apkg.py).

I tried it on 2 machines, one running arch and the other debian. No luck on either.

I looked into the packages and you need to import Apkg and db from different classes.

from ankisync2.apkg import Apkg
from ankisync2.anki21 import db

Or if you want to use anki20:

from ankisync2.anki20 import db

@TT-392 Got your problems solved? Got what you wanted?

I feel like I should close this issue.