question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`tesseract_get_version` returns cached result after version change

See original GitHub issue

The @run_once decorator on pytesseract.tesseract_get_version() means that if the version is switched via

pytesseract.pytesseract.tesseract_cmd = 'tesseract5'

for example, after pytesseract.tesseract_get_version() has been called, it no longer returns correct results.

As a complete example:

import pytesseract
pytesseract.pytesseract.tesseract_cmd = 'Tesseract/tesseract4'
print(pytesseract.get_tesseract_version())
pytesseract.pytesseract.tesseract_cmd = 'Tesseract/tesseract5'
print(pytesseract.get_tesseract_version())

gives the following (even though I have switched from version 4 to version 5)

4.1.3
 leptonica-1.78.0
  libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.2.54 : libtiff 4.0.6 : zlib 1.2.11 : libwebp 0.4.4 : libopenjp2 2.3.0
 Found AVX512BW
 Found AVX512F
 Found AVX2
 Found AVX
 Found FMA
 Found SSE
 Found libarchive 3.1.2

4.1.3
 leptonica-1.78.0
  libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.2.54 : libtiff 4.0.6 : zlib 1.2.11 : libwebp 0.4.4 : libopenjp2 2.3.0
 Found AVX512BW
 Found AVX512F
 Found AVX2
 Found AVX
 Found FMA
 Found SSE
 Found libarchive 3.1.2```

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
stefan6419846commented, Aug 18, 2022

Apart from the fact that Windows usually has a different package management, yes. All downloads/installers seem to be unofficial though in this case: https://tesseract-ocr.github.io/tessdoc/Downloads.html

0reactions
elvinagamcommented, Aug 18, 2022

DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 It actually is. Thanks, I’ll look for it.

btw, Is it the same procedure for windows to update to tesseract 5.0.0 though?

Read more comments on GitHub >

github_iconTop Results From Across the Web

opensemanticsearch/tesseract-ocr-cache
It returns OCR results only if yet cached by former runs of tesseract_cache/tesseract . If the image was not processed by OCR yet...
Read more >
Tesseract 4.5 return multiple results for same image structure
Hello everyone i have problem with tess4j with Arabic.trainddata the problem is when i get result two times the results ...
Read more >
How to Use Versioning to Update Your Cached WordPress ...
We're now going to show you how to set versions of different types of files to bust your users' cache. Keep in mind...
Read more >
Command Line Usage - Tesseract documentation
TESSDATA_PREFIX environment variable should be set to the parent directory of “tessdata” directory. The following command would give the same result as ...
Read more >
15 Tuning the Result Cache - Database
This memory pool consists of the SQL query result cache—which stores results of SQL queries—and the PL/SQL function result cache, which stores values...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found