danpla / dpscreenocr

Program to recognize text on screen
https://danpla.github.io/dpscreenocr/
zlib License
231 stars 17 forks source link

No languages detected due to TESSDATA_PREFIX #16

Closed ainal-3fresources closed 2 years ago

ainal-3fresources commented 2 years ago

Application was running previously but after

  1. a windows update and
  2. uninstallation of a local installation of tessaract (which was installed before dpscreenocr),

the application opens with the message, "Please install languages" . Assumed that no language file was installed or missing. Upon inspection, the file eng.traindata was present in the C:\Program Files (x86)\dpScreenOCR\tessdata directory. Downloading another language file and copying it to the same directory does not change the error message.

Removed and re-installed dpscreenocr several times did not yield different results. Uninstalling dpscreenocr does not remove the configuration file in C:\Users\\AppData\Local\dpscreenocr. Manually deleted the directory and re-installed dpscreenocr but still no change. Installation onto another computer with similar windows level (version 20H2 Build 19042.1466) was successful so issue is local to the computer. Does dpscreenOCR aware of other tesseract installation through environment variables?

danpla commented 2 years ago

Most likely, the Tesseract installer has left the TESSDATA_PREFIX environment variable, so removing it manually should help.

dpScreenOCR currently doesn't prevent the tesseract library to use TESSDATA_PREFIX.

ainal-3fresources commented 2 years ago

Removed the TESSDATA_PREFIX environment variable, rebooted and it works ok now. Thank you for a very handy application.

danpla commented 2 years ago

You're welcome.

joneldiablo commented 2 years ago

hi!!!! I having the same problem on linux. dpscreenocr was working ok but after I install tesseract-ocr-spa lang, then dpscreenocr not work anymore. What could I do? I have install again tesseract uninstall lang, reinstall, nothings work

danpla commented 2 years ago

Hi, Can you please tell the name and version of your Linux distro?

joneldiablo commented 2 years ago

https://github.com/danpla/dpscreenocr/issues/18#issuecomment-1045449967

danpla commented 2 years ago

Since version 1.1.0, dpScreenOCR for Windows will use an explicit data path (C:\Users\(your name)\AppData\Local\dpscreenocr\tesseract_5_data) instead of the Tesseract's built-in behavior "check TESSDATA_PREFIX, then fall back to tessdata in the directory of EXE". Thus, the program will no longer be affected by TESSDATA_PREFIX.