{"record":{"id":"d34e58a35b832972","repo":"ocrmypdf/OCRmyPDF","slug":"tesseract-5-4-0-is-not-supported-due-to-regression","errorCode":null,"errorMessage":"Tesseract 5.4.0 is not supported due to regressions in this version. Please upgrade to a newer or supported older version.","messagePattern":"Tesseract 5\\.4\\.0 is not supported due to regressions in this version\\. Please upgrade to a newer or supported older version\\.","errorType":"validation","errorClass":"MissingDependencyError","httpStatus":null,"severity":"error","filePath":"src/ocrmypdf/builtin_plugins/tesseract_ocr.py","lineNumber":318,"sourceCode":"@hookimpl\ndef add_options(parser):\n    # Use the model's CLI generation method - it now handles all Tesseract options\n    TesseractOptions.add_arguments_to_parser(parser)\n\n\n@hookimpl\ndef check_options(options):\n    \"\"\"Check external dependencies and version compatibility for Tesseract.\"\"\"\n    check_external_program(\n        program='tesseract',\n        package={'linux': 'tesseract-ocr'},\n        version_checker=tesseract.version,\n        need_version='4.1.1',  # Ubuntu 22.04 version (also 20.04)\n        version_parser=tesseract.TesseractVersion,\n    )\n    tess_version = tesseract.version()\n    if tess_version == tesseract.TesseractVersion('5.4.0'):\n        raise MissingDependencyError(\n            \"Tesseract 5.4.0 is not supported due to regressions in this version. \"\n            \"Please upgrade to a newer or supported older version.\"\n        )\n\n    # Check version-specific feature compatibility\n    if (\n        not tesseract.has_thresholding()\n        and options.tesseract.thresholding != ThresholdingMethod.AUTO\n    ):\n        log.warning(\n            \"The installed version of Tesseract does not support changes to its \"\n            \"thresholding method. The --tesseract-threshold argument will be \"\n            \"ignored.\"\n        )\n\n\n@hookimpl\ndef validate(pdfinfo, options):","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/ocrmypdf/OCRmyPDF/blob/5074a0b0e109362422b768fd271ed84bf717c4ec/src/ocrmypdf/builtin_plugins/tesseract_ocr.py#L300-L336","documentation":"Tesseract 5.4.0 has known regressions, and check_options() hard-blocks exactly that version with MissingDependencyError before any work is done, even though it passes the minimum-version gate of 4.1.1.","triggerScenarios":"Running any OCR pipeline when `tesseract --version` reports 5.4.0 (typically a distro build).","commonSituations":"Distributions that packaged 5.4.0 (some 2023-era distro releases); CI images pinned to it.","solutions":["Upgrade Tesseract to 5.4.1+ (or use a known-good 5.3.x).","In containers, build/install a newer tesseract or use an image with a fixed version; clear or adjust the cache (h)ocr of version checks if relevant."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from ocrmypdf.builtin_plugins import tesseract_ocr\ndef tess_ok():\n    from ocrmypdf.builtin_plugins.tesseract import tesseract\n    from ocrmypdf.builtin_plugins.tesseract import TesseractVersion\n    return tesseract.version() != TesseractVersion('5.4.0')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin a Tesseract version other than 5.4.0 in CI and containers.","Add a version gate at job submission time to fail fast with a clear message."],"tags":["ocrmypdf","tesseract","version-blacklist","dependency"],"backgroundTag":"unsupported-dependency-version","analyzedSha":"5074a0b0e109362422b768fd271ed84bf717c4ec","analyzedAt":"2026-08-27T11:57:38.523Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}