Search code examples
pythonocrtesseractpython-tesseract

Python-tesseract installation on Ubuntu


I am trying to install python-tesseract 0.9-0.5 from a deb file on Ubuntu 15.04, but it gives several errors. This is what I do:

1- I open the path of the file on terminal and write

sudo dpkg -i python-tesseract_0.9-0.5ubuntu2_i386.deb

2- After this, the console shows several errors:

Selecting previously unselected package python-tesseract.
(Reading database ... 349994 files and directories currently installed.)

Preparing to unpack python-tesseract_0.9-0.5ubuntu2_i386.deb ...

Unpacking python-tesseract (0.9-0.5ubuntu2) ...
dpkg: dependency problems prevent configuration of python-tesseract:
 python-tesseract depends on python (<< 2.8).
 python-tesseract depends on python (>= 2.7~).
 python-tesseract depends on liblept4.
 python-tesseract depends on libopencv-core2.4; however:
  Package libopencv-core2.4:i386 is not installed.
 python-tesseract depends on libtesseract3; however:

dpkg: error processing package python-tesseract (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:    
 python-tesseract

3- Just for checking, I open the installation file and extracted the tesseract.py class, and used alone in python. I opened it this way:

python tesseract.py 

, but I got this:

Traceback (most recent call last):
  File "tesseract.py", line 28, in <module>
    _tesseract = swig_import_helper()
  File "tesseract.py", line 20, in swig_import_helper
    import _tesseract
ImportError: No module named _tesseract

The thing is that I want to use tesseract functions on python for an optical character recognition application, and I have understood that the best wrapper for this is python-tesseract (is not the same that pytesseract, I think).

My question is: How can I to install python-tesseract on Ubuntu 15.04? Thanks a lot


Solution

  • It works installing gdebi-core first, and afterwards installing the .deb package with it, so that gdebi install dependencies for me. I used Ubuntu 14.04.

     sudo apt-get install gdebi-core
     sudo gdebi python-tesseract_0.9-0.5ubuntu2_i386.deb