dynobo / normcap

OCR powered screen-capture tool to capture information instead of images
https://dynobo.github.io/normcap/
Other
1.89k stars 89 forks source link

Error: Couldn't Locate Tesseract Binary #396

Closed qomhmd closed 1 year ago

qomhmd commented 1 year ago

I cannot run the version 0.4.0 on Windows 10 since a while:

Traceback (most recent call last):
  File "\app\normcap\__main__.py", line 6, in <module>
    main()
  File "\app\normcap\app.py", line 56, in main
    tray = SystemTray(app, vars(args))
  File "\app\normcap\gui\tray.py", line 71, in __init__
    logger.debug("System info:\n%s", system_info.to_dict())
  File "\app\normcap\gui\system_info.py", line 163, in to_dict
    "tesseract_path": get_tesseract_path(),
  File "\app\normcap\gui\system_info.py", line 70, in get_tesseract_path
    raise RuntimeError(f"Couldn't locate tesseract binary in {tesseract_path}!")
RuntimeError: Couldn't locate tesseract binary in \app\normcap\resources\tesseract\tesseract.exe!
dynobo commented 1 year ago

Hi @qomhmd, thanks for reporting this issue. Can you provide some more information? That would help me a lot!

  1. Did you install NormCap as Python package (pip install normcap) or did you use the installer (normcap-[...].msi)?
  2. Could you please try to getting a full debug log?
    • For the pip installed version: normcap -v debug
    • For the msi installed version: %LOCALAPPDATA%\Programs\dynobo\NormCap\NormCap.exe -- -v debug

Thanks!

qomhmd commented 1 year ago

Hi dear @dynobo.

  1. I used the installer, updating from a previous version (I am a NormCap user since a few versions ago).
  2. The log is:
    
    Log started: 2023-03-12 00:41:10Z
    PreInitializing Python runtime...
    PythonHome: C:\Users\qodra\AppData\Local\Programs\dynobo\NormCap
    PYTHONPATH:
    - C:\Users\qodra\AppData\Local\Programs\dynobo\NormCap\python310.zip
    - C:\Users\qodra\AppData\Local\Programs\dynobo\NormCap
    - C:\Users\qodra\AppData\Local\Programs\dynobo\NormCap\app_packages
    - C:\Users\qodra\AppData\Local\Programs\dynobo\NormCap\app
    Configure argc/argv...
    Initializing Python runtime...
    Running app module: normcap
    ---------------------------------------------------------------------------
    00:41:12 - INFO    - normcap:29 - Start NormCap v0.4.0
    00:41:12 - DEBUG   - normcap:208 - [QT] qtwarningmsg - qwindowscontext: oleinitialize() failed:  "com error 0xffffffff80010106 rpc_e_changed_mode (cannot change thread mode after it is set.)"
    Traceback (most recent call last):
    File "\app\normcap\__main__.py", line 6, in <module>
    main()
    File "\app\normcap\app.py", line 56, in main
    tray = SystemTray(app, vars(args))
    File "\app\normcap\gui\tray.py", line 71, in __init__
    logger.debug("System info:\n%s", system_info.to_dict())
    File "\app\normcap\gui\system_info.py", line 163, in to_dict
    "tesseract_path": get_tesseract_path(),
    File "\app\normcap\gui\system_info.py", line 70, in get_tesseract_path
    raise RuntimeError(f"Couldn't locate tesseract binary in {tesseract_path}!")
    RuntimeError: Couldn't locate tesseract binary in \app\normcap\resources\tesseract\tesseract.exe!

Application quit abnormally (Exit code -6)! Traceback (most recent call last): File "runpy.py", line 196, in _run_module_as_main File "runpy.py", line 86, in _run_code File "C:\Users\qodra\AppData\Local\Programs\dynobo\NormCap\app\normcap__main.py", line 6, in main() File "C:\Users\qodra\AppData\Local\Programs\dynobo\NormCap\app\normcap\app.py", line 56, in main tray = SystemTray(app, vars(args)) File "C:\Users\qodra\AppData\Local\Programs\dynobo\NormCap\app\normcap\gui\tray.py", line 71, in init__ logger.debug("System info:\n%s", system_info.to_dict()) File "C:\Users\qodra\AppData\Local\Programs\dynobo\NormCap\app\normcap\gui\system_info.py", line 163, in to_dict "tesseract_path": get_tesseract_path(), File "C:\Users\qodra\AppData\Local\Programs\dynobo\NormCap\app\normcap\gui\system_info.py", line 70, in get_tesseract_path raise RuntimeError(f"Couldn't locate tesseract binary in {tesseract_path}!") RuntimeError: Couldn't locate tesseract binary in C:\Users\qodra\AppData\Local\Programs\dynobo\NormCap\app\normcap\resources\tesseract\tesseract.exe!

dynobo commented 1 year ago

Thanks for the log, @qomhmd :-) NormCap seems to look in the correct path for tesseract:

C:\Users\qodra\AppData\Local\Programs\dynobo\NormCap\app\normcap\resources\tesseract\tesseract.exe

The question is: why is it not there? :thinking:

Could you please verify, that the tesseract.exe is really not in the path above? (I don't think it is, but just to be sure...)

My best guesses are, that either something went wrong during the update process, or the tesseract.exe somehow got moved, e.g. by an antivirus or something...

Could you please try uninstalling NormCap again completely, and reinstalling it afterwards?

qomhmd commented 1 year ago

Yes, the binary was missing from the path. I re-installed and the error has gone. Thanks again.