Open gety9 opened 2 years ago
Sorry to say that I have very little knowledge of Windows 10. I'll leave this comment open for a while in case anyone else has a suggestion.
I'd write my workaround.
Replace all backslash to forward slashes. tessdata_dir.replace("\\", "/")
.
After making the necessary changes, the program works. Windows 10, Python 3.10.4.
Also I found out that the built-in Tesseract data that my installation has is more superior compared to the shipped one, so I removed the related line entirely.
Replace all backslash to forward slashes. tessdata_dir.replace("\", "/").
Thank you, I was trying to find a problem all day
If anyone wants to submit a patch to make this more portable across Linux/Windows, please do!
When i run
python -m table_ocr.demo https://raw.githubusercontent.com/eihli/image-table-ocr/master/resources/test_data/simple.png
i get
pytesseract.pytesseract.TesseractError: (1, 'Error opening data file C:UsersGetyAppDataLocalProgramsPythonPython38libsite-packagestable_ocrtessdata/table-ocr.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language \'table-ocr\' Tesseract couldn\'t load any languages! Could not initialize tesseract.')
(note file path does not have '/')
File does exist
I tried setting env variable TESSDATA_PREFIX - same error.
as well as specifying path in cli
python -m table_ocr.demo https://raw.githubusercontent.com/eihli/image-table-ocr/master/resources/test_data/simple.png --tessdata-dir C:\Users\Btycoon\AppData\Local\Programs\Python\Python38\Lib\site-packages\table_ocr\tessdata
I am on Windows 10.
I am also getting same error. Did you solve this problem?
你好!邮件已收到,谢谢!
I'd write my workaround.
Replace all backslash to forward slashes.
tessdata_dir.replace("\\", "/")
.After making the necessary changes, the program works. Windows 10, Python 3.10.4.
How do I run this project after I make changes? I am new to this. So can you please guide on how to run this project? Thanks
When i run
python -m table_ocr.demo https://raw.githubusercontent.com/eihli/image-table-ocr/master/resources/test_data/simple.png
i get
pytesseract.pytesseract.TesseractError: (1, 'Error opening data file C:UsersGetyAppDataLocalProgramsPythonPython38libsite-packagestable_ocrtessdata/table-ocr.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language \'table-ocr\' Tesseract couldn\'t load any languages! Could not initialize tesseract.')
(note file path does not have '/')
File does exist
I tried setting env variable TESSDATA_PREFIX - same error.
as well as specifying path in cli
python -m table_ocr.demo https://raw.githubusercontent.com/eihli/image-table-ocr/master/resources/test_data/simple.png --tessdata-dir C:\Users\Btycoon\AppData\Local\Programs\Python\Python38\Lib\site-packages\table_ocr\tessdata
I am on Windows 10.