I up loaded Tesseract-OCR Folder on gitup but on railway cant't find

pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your PATH. See README file for more information. and I have defind path TESSERACT_CMD = os.path.join(BASE_DIR, 'ocr/ocrdata/Tesseract-OCR/tesseract.exe')
6 Replies
Percy
Percy15mo ago
Project ID: ed033977-1d4b-4c4d-ad01-9a18391a759b
Brody
Brody15mo ago
railway runs linux, the windows executable is not going to work, but there is a better way first, remove that TESSERACT_CMD variable from your code, it will only get in the way. then add this as a nixpacks.toml file to your project
[phases.setup]
nixPkgs = ['...', 'tesseract']
[phases.setup]
nixPkgs = ['...', 'tesseract']
danainan0
danainan015mo ago
can i update tesseract 5 That my error raise TesseractError(proc.returncode, get_errors(error_string)) pytesseract.pytesseract.TesseractError: (-11, 'Cube ERROR (CubeRecoContext::Load): unable to read cube language model params from /nix/store/hh4igg5xn97p777dmf4j2kgxp2casksf-tesseract-3.05.00/share/tessdata/tha.cube.lm Cube ERROR (CubeRecoContext::Create): unable to init CubeRecoContext object init_cube_objects(false, &tessdata_manager):Error:Assert failed:in file tessedit.cpp, line 210')
Brody
Brody15mo ago
that is tesseract 5 afaik
danainan0
danainan015mo ago
custom_oem_psm_config = r'--oem 1 --psm 1' tessdata_dir_config = f'--tessdata-dir {settings.OCR_PATH}' text = image_to_string(media_path,lang='tha+eng',config=custom_oem_psm_config+''+tessdata_dir_config) print(text) This my code
Brody
Brody15mo ago
at first glance this seems like a code issue
Want results from more Discord servers?
Add your server