Skip to content Skip to sidebar Skip to footer

Is There Any Way To Install Tesseract Ocr In A Venv/web Server?

I made a Python script that does OCR, and then I recycled the script and made a web app using Flask. The web app and its libraries are in a virtualenv, but the app is using the Tes

Solution 1:

This would depend on the operating system of the server which you're deploying to. If you're running in docker, this is the OS of the base image.

Most likely you'll install from from a pre-built binary.

Once you've installed, locate the binary. On linux use the command:

which tesseract

this will output something like:

/usr/bin/tesseract

Then in your application code, as per the usage instructions point pytesseract to this binary:

pytesseract.pytesseract.tesseract_cmd = r'/usr/bin/tesseract'

Solution 2:

If the problem you're facing is ModuleNotFoundError: No module named 'Image' even after installing Pillow, run:

python -m pip install --upgrade pip
python -m pip install --upgrade Pillow

After that, you should be able to install pytesseract without errors.

Post a Comment for "Is There Any Way To Install Tesseract Ocr In A Venv/web Server?"