cfculhane / AnkiOCR

Anki Addon to create searchable text from images in notes, using Tesseract OCR
MIT License
17 stars 5 forks source link

"TypeError: find_notes() got an unexpected keyword argument 'query'" when running OCR #18

Closed Selduro closed 3 years ago

Selduro commented 3 years ago

Just installed the addon.

Im using Anki version 2.1.42. When trying to run ocr I get the following error:

Error encountered during processing, attempting to stop AnkiOCR gracefully. Error below:
Traceback (most recent call last):
   File "C:\Users\Max\AppData\Roaming\Anki2\addons21\450181164\gui.py", line 54, in on_run_ocr
    ocr.run_ocr_on_notes(note_ids=selected_nids)
   File "C:\Users\Max\AppData\Roaming\Anki2\addons21\450181164\ocr.py", line 303, in run_ocr_on_notes
    notes_query = self.run_ocr_on_query(query=query_str)
   File "C:\Users\Max\AppData\Roaming\Anki2\addons21\450181164\ocr.py", line 266, in run_ocr_on_query
    notes_query = NotesQuery(col=self.col, query=query)
   File "<string>", line 7, in __init__
   File "C:\Users\Max\AppData\Roaming\Anki2\addons21\450181164\api.py", line 216, in __post_init__
    self.notes = [OCRNote(note_id=nid, col=self.col) for nid in self.col.findNotes(query=self.query)]
 TypeError: find_notes() got an unexpected keyword argument 'query'

It doesn't matter whether I'm trying to run ocr on a single note or on multiple notes, the error remains.

kevini15 commented 3 years ago

I'm experiencing the same error and am also on 2.1.42 - I also disabled all other addons and the problem still persisted. The latest version on which AnkiOCR works is 2.1.40, which I have downgraded to just now in order to use AnkiOCR.

cfculhane commented 3 years ago

Thanks for this, fixing it now :)