Using Tesseract OCR locally from a Mac

145 Views Asked by At

I am trying to run a Kotlin program on my local MacBook where I'm using Tesseract OCR.

I have set in my POM, and installed it both via Homebrew and MacPorts.

Now for some reason I keep getting an error while running the application stating /usr/lib/libleptonica.6.dylib can not be found. Now I checked where the libleptonica.6.dylib file actually is, and it's in some homebrew folder.

Does anyone know how I can fix this? I don't want to meddle around in the files too much, and I also don't have a clue what I should do anyhow.

I'm using the lastest version of Tesseract.

Below is the entire error log:

  Referenced from: <4D3F412E-DC28-3E28-8820-A02516348BE4> /Users/xxx/Library/Caches/JNA/temp/jna2981618530441004694.tmp
  Reason: tried: '/Users/xxx/Library/Caches/JNA/temp/../../../../opt/leptonica/lib/libleptonica.6.dylib' (no such file), '/usr/lib/libleptonica.6.dylib' (no such file, not in dyld cache)
    at com.sun.jna.Native.open(Native Method)
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:298)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:483)
    at com.sun.jna.Native.register(Native.java:1774)
    at com.sun.jna.Native.register(Native.java:1493)
    at net.sourceforge.tess4j.TessAPI1.<clinit>(TessAPI1.java:41)
    at PagesProcessor.<init>(PipelineV2.kt:271)
    at SingleBatchPipeline.<init>(PipelineV2.kt:142)
    at Main.main$lambda$6$lambda$5(PipelineV2.kt:95)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)```
0

There are 0 best solutions below