wolfmanstout / screen-ocr

Easily perform OCR on portions of the screen, choosing from a selection of backends.
Apache License 2.0
41 stars 7 forks source link

WARNING: screen-ocr 0.1.0 does not provide the extra 'winrt' #10

Closed willwade closed 2 years ago

willwade commented 2 years ago

So I'm installing and getting this error:

PS C:\GitHub> pip install screen-ocr[winrt] 
Collecting screen-ocr[winrt]
  Using cached screen_ocr-0.3.0-py3-none-any.whl (15 kB)
Requirement already satisfied: rapidfuzz in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from screen-ocr[winrt]) (2.11.1)
Requirement already satisfied: pillow in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from screen-ocr[winrt]) (9.2.0)
  Using cached screen_ocr-0.2.0-py2.py3-none-any.whl (13 kB)
Requirement already satisfied: numpy in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from screen-ocr[winrt]) (1.23.0)
Requirement already satisfied: scikit-image in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from screen-ocr[winrt]) (0.19.3)
  Using cached screen_ocr-0.1.1-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: pandas in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from screen-ocr[winrt]) (1.5.0)
  Using cached screen_ocr-0.1.0-py2.py3-none-any.whl (12 kB)
WARNING: screen-ocr 0.1.0 does not provide the extra 'winrt'
Requirement already satisfied: pytesseract in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from screen-ocr[winrt]) (0.3.10)
Requirement already satisfied: pytz>=2020.1 in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from pandas->screen-ocr[winrt]) (2022.4)
Requirement already satisfied: python-dateutil>=2.8.1 in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from pandas->screen-ocr[winrt]) (2.8.2)
Requirement already satisfied: packaging>=21.3 in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from pytesseract->screen-ocr[winrt]) (21.3)
Requirement already satisfied: networkx>=2.2 in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from scikit-image->screen-ocr[winrt]) (2.8.7)
Requirement already satisfied: scipy>=1.4.1 in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from scikit-image->screen-ocr[winrt]) (1.9.2)
Requirement already satisfied: PyWavelets>=1.1.1 in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from scikit-image->screen-ocr[winrt]) (1.4.1)
Requirement already satisfied: tifffile>=2019.7.26 in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from scikit-image->screen-ocr[winrt]) (2022.10.10)
Requirement already satisfied: imageio>=2.4.1 in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from scikit-image->screen-ocr[winrt]) (2.22.1)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from packaging>=21.3->pytesseract->screen-ocr[winrt]) (3.0.9)
Requirement already satisfied: six>=1.5 in c:\users\wwade\appdata\local\programs\python\python310\lib\site-packages (from python-dateutil>=2.8.1->pandas->screen-ocr[winrt]) (1.16.0)
Installing collected packages: screen-ocr
Successfully installed screen-ocr-0.1.0
WARNING: You are using pip version 22.0.4; however, version 22.2.2 is available.
You should consider upgrading via the 'C:\Users\wwade\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.
PS C:\GitHub>

Its windows 10. Win 64. Is there anything else I should install?

wolfmanstout commented 2 years ago

Looks like WinRT is not yet supported on 3.10. You'll have to use 3.9: https://pypi.org/project/winrt/#files

Hopefully that's it. Not sure why the log mentions earlier versions of my package ...

LoggeL commented 2 years ago

There's also https://github.com/pywinrt/python-winsdk/ which aims to replace it. Sadly I couldn't make it work tho. Might still be interesting since it seems like winrt isn't maintained anymore.

wolfmanstout commented 1 year ago

Unfortunately winsdk isn't working for me either (tested on Python 3.9). I tried changing the imports from winrt to winsdk and it quietly crashes Python on this line (before OCR has even been run): https://github.com/wolfmanstout/screen-ocr/blob/e5132770c1d40e85c6edbd24775ba1bf69b8a2db/screen_ocr/_winrt.py#L39

LoggeL commented 1 year ago

Yeah had similar results. The datawriter just silently crashed the process :/

wolfmanstout commented 1 year ago

Bug filed: https://github.com/pywinrt/python-winsdk/issues/20

wolfmanstout commented 1 year ago

FYI I updated the package to use winsdk now that it is working.