Installing Tesseract

I have tried every possible solution to install Tesseract on my render server. DOCKER IS NOT AN OPTION.

  1. You cannot use sudo or apt to install anything
    ie, sudo apt install tesseract-ocr
  2. You cannot build the installer natively because the environment is read-only
    ie. git clone GitHub - tesseract-ocr/tesseract: Tesseract Open Source OCR Engine (main repository)
    cd tesseract
    ./autogen.sh
    ./configure
    make
    make install
    ldconfig
  3. You cannot install from a prebuilt binary because dpkg requires superuser status.
    ie. wget https://notesalexp.org/tesseract-ocr/buster/pool/main/t/tesseract/tesseract-ocr_4.1.3-2_amd64.deb
    dpkg -i tesseract-ocr_4.1.3-2_amd64.deb

Alan (@al_ps) said on another topic thread “Alternatively, you might be able to manually install it on a Native Environment as part of a build script, if you have prebuilt binaries to download”
Is what he said true? What am I missing? How can I go about installing tesseract onto my web service on render?
This is a serious problem and I refuse to believe going the docker route is the only solution.
Thanks,

Hi,

Native environments have common tools and utilities included, however “Tesseract-OCR” isn’t one of them. The permissions of Native Environments are also restricted, preventing apt-get and OS-level package installs.

What I said in another post is true. If you have a prebuilt binary, you can use the Build Command to add that to the environment and reference it directly, as customers already do with things like Chrome, dotnet, etc.

I have to admit, I’m not familiar with Tesseract, so it’s possible a self-contained binary may not be an option. OS-level package installs won’t be possible with dpkg -i, due to the permission-levels mentioned above. dpkg -x would allow you to extract the contents, which you might be able to reference directly, however, depending on any other dependencies or assumed file/library locations, that may or may not work.

I see you say Docker isn’t an option, but it gives you a lot more control over the app’s environment to be able to set it up exactly as you require, installing simply with apt-get, without having to come up with complex workarounds to Native Environment permissions.

I was able to spin up this working (but trivial) pytesseract/Tesseract-OCR example in a few minutes: https://github.com/BigAlRender/pytesseract-docker-example

Kind regards

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.