RoR-Tesseract-Heroku icon indicating copy to clipboard operation
RoR-Tesseract-Heroku copied to clipboard

File Missing

Open jordanmichaelrushing opened this issue 10 years ago • 18 comments

Hey hoping you can help me. Trying to use your code to build an ocr thing for my site. I have this located up on heroku using the multipack and what not. But when I try to POST an image, the executable returns tesseract: error while loading shared libraries: libtiff.so.4: cannot open shared object file: No such file or directory. Any idea how to fix this? Thanks so much!

jordanmichaelrushing avatar Feb 12 '15 19:02 jordanmichaelrushing

Hey! Thanks for sharing this. I'm having the same problem posting an image after having deployed the server to Heroku. Fouady do you have an idea how to fix this?

thcottin avatar Feb 18 '15 23:02 thcottin

Hey. Apparently the link to tesseract binaries in Heroku Buildpack Tesseract wasn't accessible. I have updated the link. Hope this will fix the problem. I haven't tested it but let me know if it doesn't work.

fouady avatar Feb 24 '15 08:02 fouady

I'll test it out today. Thanks so much for writing this code and responding. If it's good to go, I'll close this out.

jordanmichaelrushing avatar Feb 24 '15 13:02 jordanmichaelrushing

Nope, still getting tesseract: error while loading shared libraries: libtiff.so.4: cannot open shared object file: No such file or directory. I vimed into vendor and see the tesseract-ocr folder. Inside it are bin, lib, & tessdata. bin has the tesseract executible. lib has liblept.so.3 & libtesseract.so.3. Andtessdata` has...

dan-frak.traineddata   fra.traineddata
deu-frak.traineddata   nld.traineddata
deu.traineddata        nor.traineddata
eng.cube.bigrams       rus.cube.fold
eng.cube.fold          rus.cube.lm
eng.cube.lm        rus.cube.nn
eng.cube.nn        rus.cube.params
eng.cube.params        rus.cube.size
eng.cube.size          rus.cube.word-freq
eng.cube.word-freq     rus.traineddata
eng.tesseract_cube.nn  slk-frak.traineddata
eng.traineddata        spa.cube.bigrams
fin.traineddata        spa.cube.fold
fra.cube.bigrams       spa.cube.lm
fra.cube.fold          spa.cube.nn
fra.cube.lm        spa.cube.params
fra.cube.nn        spa.cube.size
fra.cube.params        spa.cube.word-freq
fra.cube.size          spa_old.traineddata
fra.cube.word-freq     spa.traineddata
fra.tesseract_cube.nn  swe.traineddata

I'm guessing the libtiff.so.4 should be in lib, but doesn't look like it's there.

jordanmichaelrushing avatar Feb 24 '15 14:02 jordanmichaelrushing

Also I tried using a brand new heroku app with brand new code, and still no go..

jordanmichaelrushing avatar Feb 24 '15 16:02 jordanmichaelrushing

Were you able to solve the problem?

fouady avatar Mar 13 '15 08:03 fouady

No I wasn't unfortunately. I was able to get a different repo's code to work though.

jordanmichaelrushing avatar Mar 13 '15 15:03 jordanmichaelrushing

I'm also getting the error with this buildpack https://github.com/fouady/heroku-buildpack-tesseract:

tesseract: error while loading shared libraries: libtiff.so.4: cannot open shared object file: No such file or directory

libtiff.so.4 appears to be missing from the cedar-14 heroku stack and replaced by libtiff.so.5.

Is it possible for the buildpack to include the libtiff.so.4 version of the library?

Related issues

  • https://github.com/alex88/heroku-buildpack-vips/issues/9

BrandonClapp avatar Apr 02 '15 04:04 BrandonClapp

I was able to get the buildpack to work by using an additional buildpack for apt. https://github.com/ddollar/heroku-buildpack-apt

I then needed to use it to install libtiff4 and libjpeg62. For an example, check my .buildpacks and Aptfile at https://github.com/BrandonClapp/quollect

BrandonClapp avatar Apr 03 '15 01:04 BrandonClapp

I forked https://github.com/fouady/Heroku-Buildpack-Tesseract to correct the issue without using additional buildpacks. You can find my fork at https://github.com/matteotiziano/heroku-buildpack-tesseract.

First, I compiled the missing libraries libtiff4 and libjpeg62 in a bash shell of a Heroku Dyno heroku run bash, then I downloaded the compiled files using scp, and finally I merged them with the Tesseract package provided by @fouady at http://www.weebly.com/uploads/1/1/5/1/11516991/tesseract-ocr-3.02.02.tar.gz; for convenience, I included the updated tarball in my buildpack.

matteotiziano avatar May 27 '15 00:05 matteotiziano

I followed the idea of @BrandonClapp and works for me. Thanks @BrandonClapp :heart:

maurogeorge avatar Aug 27 '15 14:08 maurogeorge

Followed using @matteotiziano buildpack and it works mostly. It seems libgif is not included? 'tesseract: error while loading shared libraries: libgif.so.4: cannot open shared object file: No such file or directory' Trying to figure out how to fix this..

ksfire avatar Jun 09 '18 23:06 ksfire

@ksfire Any luck?, I am also stuck on this problem.

Buyachaka avatar Jun 12 '18 15:06 Buyachaka

@Buyachaka no, was not able to solve it

ksfire avatar Jul 09 '18 23:07 ksfire

@ksfire Probably something has changed in Heroku and libgif is no longer included / available. Have you tried following the same approach I have described in my previous message (i.e., compiling the missing library in a Heroku bash session and then include it in the Tesseract package)?

matteotiziano avatar Jul 13 '18 12:07 matteotiziano

tesseract: error while loading shared libraries: libpng12.so.0: cannot open shared object file

got this new error i think its similar to what u ppl r trying to solve... it will be great if u people help me out

PranayRaj2801 avatar Apr 27 '20 10:04 PranayRaj2801

I get this error pytesseract.pytesseract.TesseractError: (127, 'tesseract: error while loading shared libraries: libarchive.so.13: cannot open shared object file: No such file or directory.

Soumi7 avatar Feb 07 '21 10:02 Soumi7

You can try mine if you don't have a solution yet, I just built this and have tested in production - I only have english language support at the present: https://github.com/xaptronic/heroku-buildpack-tesseract

xaptronic avatar May 14 '21 00:05 xaptronic