Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: [Errno 2] No such file or directory: '.../collection.anki21' #12

Open
NicolasMICAUX opened this issue Sep 25, 2022 · 3 comments

Comments

@NicolasMICAUX
Copy link

When opening an Apkg (deck exported from Anki2.1.15 (442df9d6), with ankisync2 0.3.4 and python 3.10.6), I get the following error :

  File "xxx.py", line 4, in <module>
    with Apkg('xxxx.apkg') as apkg:
  File "xxx/venv/lib/python3.10/site-packages/ankisync2/apkg.py", line 49, in __init__
    shutil.copy(
  File "/usr/lib/python3.10/shutil.py", line 417, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.10/shutil.py", line 254, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'xxxx/collection.anki21'
python-BaseException

Any idea why ?

@Mike7154
Copy link

I get the same issue. Did you find a solution yet?

@Mike7154
Copy link

Did some digging. When I open the .apkg file with winrar, I find that collection.anki21 doesn't exist. Only collection.anki2. I modified the py file "xxx/venv/lib/python3.10/site-packages/ankisync2/apkg.py" (lines 42 and 47) to look for collection.anki2 instead of collection.anki21. It loaded, but I'm not sure if everything will work the same downstream yet.

@Mike7154
Copy link

I made the changes and made a pull request with the changes. It seems to work. pull request #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants