Closed DavraYoung closed 2 years ago
Sounds like this line is returning None:
engine = ocr.OcrEngine.try_create_from_user_profile_languages()
This is a Windows API. You should be able to reproduce this by running the following in a Python REPL:
import winrt
import winrt.windows.media.ocr as ocr
engine = ocr.OcrEngine.try_create_from_user_profile_languages()
engine
If engine is None, then that confirms that this is the problem. I'm not sure why this would be. The documentation indicates that this could be because your configured language is not supported. Are you using some language other than English?
Issue solved. The problem was in language pack.
For any one who faces this issue:
Thank you for debugging this! Improved the error message to point here.
I tried to install this package with winrt, but on import I got this error:
Steps:
pip install screen-ocr[winrt]
python -m screen_ocr
OC: Windows 10 Python: 3.7.0