1

I am having trouble installing python-tesseract on my linux system. I've been using this tutorial: http://delimitry.blogspot.be/2014/10/installing-tesseract-for-python-on.html

The error I get is:

 File does not exist:['/usr/include/tesseract/capi.h', '/usr/local/include/tesseract/capi.h', '/opt/include/tesseract/capi.h', '/opt/local/include/tesseract/capi.h']
root@opencv:/home/philipp/python-tesseract#

When running python setup.py clean in /python-tesseract after following the rest of the instructions in order.

Running linux 3.2.0-4-amd64 on this system.

Whereis tesseract-ocr returns:

/usr/share/tesseract-ocr

Whereis leptonica returns:

/usr/include/leptonica

Whereis tesseract returns:

tesseract: /usr/bin/tesseract /usr/bin/X11/tesseract /usr/include/tesseract/ /usr/share/man/man1/tesseract.1.gz

I've also tried running a few other tutorials/guides to install python-tesseract that have returned other errors such as, missing libleptonica then missing libc6 but I havn't investigated these as much. Just tried to see if any other guides worked immidiately. Also, when I run tesseract in the terminal it works, but import tesseract does not.

What am I doing wrong? How can I fix this and install python-tesseract?

  • Hum. I'd start by installing `libleptonica` and `libc6`. Right now, it seems like you have tesseract installed, but not the python bindings for tesseract. Alternatively, it seems to be available via `pip`. – NightShadeQueen Aug 07 '15 at 13:21
  • You should use one of the already existuing tesseract buildpacks, like explained here https://stackoverflow.com/questions/53363547/how-to-deploy-pytesseract-to-heroku – Gonzalo Odiard Dec 29 '21 at 19:01

1 Answers1

1

I think this way could work for you:

1- download python-tesseract_0.9-0.5ubuntu3_vivid_amd64.deb from here

2- install gdebi-core

sudo apt-get install gdebi-core

3- install python-tesseract_0.9-0.5ubuntu3_vivid_amd64.deb with gdebi

sudo gdebi python-tesseract_0.9-0.5ubuntu2_i386.deb
dennis quaderer
  • 25
  • 1
  • 1
  • 6
  • Can you please explain how this would solve the issue? – John Odom Mar 29 '16 at 21:31
  • In this way, we would get python-tesseract almost ready for working. The only remaining is to configure the environment variable TESSDATA_PREFIX, with something like this, in terminal: export TESSDATA_PREFIX=/usr/share/tesseract-ocr/ . I had problems for installing python-tesseract on ubuntu 14.04. When I tried to install the .deb file, the installation had problems with dependencies, issue solved with gdebi-core, that allows to install the dependencies needed for a .deb. I hope it helps. – dennis quaderer Mar 30 '16 at 02:42
  • You should use one of the already existuing tesseract buildpacks, like explained here https://stackoverflow.com/questions/53363547/how-to-deploy-pytesseract-to-heroku – Gonzalo Odiard Dec 29 '21 at 19:01