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

Error after Anki 2.1.64 #41

Open
Gabrusp opened this issue Oct 4, 2023 · 1 comment
Open

Error after Anki 2.1.64 #41

Gabrusp opened this issue Oct 4, 2023 · 1 comment

Comments

@Gabrusp
Copy link

Gabrusp commented Oct 4, 2023

Hello, first of all, thank you for this amazing addon. Unfortunately, it no longer works on Anki versions after 2.1.64. When I try to use it, I get the error below:

Error encountered during processing. Debug info:
Anki Version: 23.10 , AnkiOCR Version: 0.7.1
Platform: Windows , Python Version: 3.9.15 (main, Nov 6 2022, 02:45:15) [MSC v.1929 64 bit (AMD64)]Traceback (most recent call last):
File "C:\Users\XXXXX\AppData\Roaming\Anki2\addons21\450181164\gui.py", line 58, in on_run_ocr
ocr.run_ocr_on_notes(note_ids=selected_nids)
File "C:\Users\XXXXX\AppData\Roaming\Anki2\addons21\450181164\ocr.py", line 309, in run_ocr_on_notes
notes_query = self.run_ocr_on_query(note_ids=note_ids)
File "C:\Users\XXXXX\AppData\Roaming\Anki2\addons21\450181164\ocr.py", line 279, in run_ocr_on_query
raw_results = self._ocr_batch_process(batched_txts=batched_txts)
File "C:\Users\XXXXX\AppData\Roaming\Anki2\addons21\450181164\ocr.py", line 97, in _ocr_batch_process
raw_results[batched_img_txt] = future.result()
File "concurrent.futures._base", line 439, in result
File "concurrent.futures._base", line 391, in __get_result
File "concurrent.futures.thread", line 58, in run
File "C:\Users\XXXXX\AppData\Roaming\Anki2\addons21\450181164\ocr.py", line 265, in _ocr_img
return pytesseract.image_to_string(str(img_pth), lang="+".join(languages or ["eng"]),
File "C:\Users\XXXXX\AppData\Roaming\Anki2\addons21\450181164_vendor\pytesseract\pytesseract.py", line 416, in image_to_string
return {
File "C:\Users\XXXXX\AppData\Roaming\Anki2\addons21\450181164_vendor\pytesseract\pytesseract.py", line 419, in
Output.STRING: lambda: run_and_get_output(*args),
File "C:\Users\XXXXX\AppData\Roaming\Anki2\addons21\450181164_vendor\pytesseract\pytesseract.py", line 287, in run_and_get_output
run_tesseract(**kwargs)
File "C:\Users\XXXXX\AppData\Roaming\Anki2\addons21\450181164_vendor\pytesseract\pytesseract.py", line 263, in run_tesseract
raise TesseractError(proc.returncode, get_errors(error_string))
450181164._vendor.pytesseract.pytesseract.TesseractError: (1, "read_params_file: Can't open txt Tesseract Open Source OCR Engine v5.0.0-alpha.20200328 with Leptonica Error in fopenReadStream: file not found Error in pixRead: image file not found: C:\Users\XXXXX\AppData\Roaming\Anki2\Usuário 1\collection.media\paste-32998233735169.jpg Image file C:\Users\XXXXX\AppData\Roaming\Anki2\Usuário 1\collection.media\paste-32998233735169.jpg cannot be read! Error during processing.")

@Gabrusp
Copy link
Author

Gabrusp commented Oct 13, 2023

I noticed that AnkiOCR uses the distutils module, so maybe it's related:

ankitects/anki#2723

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

1 participant