-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on engine creation on .NET 8 in Linux environment (docker container) #62
Comments
Try setting the loglevel to debug and see where it tries to find the needed file. |
Yes it tries to do it but fails even though the file being there.
|
I don't know how I can solve this for you, are you sure that the files are in one of those folders where TesseractOCR is looking and that they are compiled in the correct format? ... with this I mean x64 when your app is 64 bit and x86 when it is 32 bits. |
This issue has been resolved. Thanks for your support! |
I'm on a Windows machine and the problem is that I don't know how to compile the DLL's for Linux so If you could ask your collegues to supply me with the given .so files than I will include them in the nuget package. At this right moment I'm making a new version that is compiled against this release --> https://github.com/tesseract-ocr/tesseract/releases/tag/5.4.1 So if your collegue could supply me with that version compiled for Linux than I will include them. Please try to compile versions for x86 and x64 ... I know that x86 code is not used that much anymore but I try to also make it work if for whatever reason someone is stuck on a 32 bit machine. |
I have tried to fetch the so libraries from an Ubuntu 22.04 (Jammy) and copy them in the container but the issue remains. Below you can find the docker commands I use to download the libraries from repo for v. 5.4.1 and use tesseract in a webapi.
The commands install At the very bottom we create few symbolic links to leptonica and tesseract using the naming referenced in TesseracOCR. Without this symlink we will have another error for
|
Hello, I am one of @francisco-coelho-external 's colleagues. We run TesseractOCR on a container with a Debian image build from a dockerfile/yaml similar to @Leftyx 's in the way it install's the dependencies and links them. Since we updated our codebase to .NET8, however, we had to upgrade TesseractOCR as well. The problem here is that Debian's repositories (and Ubuntu's for that matter) have yet to upgrade their libleptonica packages to 1.83.1/1.84 in their stable sources. We have tested with using library packages from different Linux distro repositories as well as building said libraries from source, within different distros. After some research and testing we came to realize that .so files aren't necessarily portable between linux distros. For example the .so libleptonica1.83.1 built on Ubuntu wouldn't work on Debian when the same building procedure done in Debian would work. The same goes for using libleptonica's packages from Debian's repository vs Ubuntu's repository. Only the ones from Debian's repository worked in our Debian machine, when running TesseractOCR. I believe this is due to differences in the packages of the different dependencies between different distros. As such it will not help you for us to share the .so files with you as different Linux distros require different .so's. On the other hand I believe it would make better sense for TesseractOCR to guarantee in its search path for the relevant .so files that it looks under the standard installation paths of libraries in Linux instead (see [https://www.baeldung.com/linux/check-shared-library-installed#standard-library-paths for example). |
Hi,
I have an error on engine creation that didn't happen on .NET 7 but occurs on .NET 8. I'm using the latest version 5.3.5.
This happens when the app runs inside a Linux-based container (Ubuntu). On Windows machines, it all goes well.
The structure of the project (clipped):
The error:
Failed to find library 'libleptonica-1.83.1.dll.so' for platform x64
The code that raises the error:
using var engine = new Engine(_tessdata, language, EngineMode.LstmOnly);
The stack trace:
at TesseractOCR.InteropDotNet.LibraryLoader.LoadLibrary(String fileName, String platformName) at InteropRuntimeImplementer.LeptonicaApiSignaturesInstance.LeptonicaApiSignaturesImplementation..ctor(LibraryLoader loader) at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span 1 copyOfArgs, BindingFlags invokeAttr)
The .so files are being copied on the build and, like I said, it all worked before I upgraded to .NET 8.
I hope this can help you helping me.
Best regards,
Francisco Coelho
The text was updated successfully, but these errors were encountered: