Cogs and Levers A blog full of technical stuff

Installing pyocr on Debian

Introduction

Today’s post is an installation guide to get pyocr up and running on a Debian Linux style distribution.

Prepare your python environment:

sudo apt-get install build-tools python-dev
sudo apt-get install python-setuptools
sudo easy_install pip

Install the operating system implementations of the OCR programs. In order to do this, you my need to enable the non-free repositories within your apt settings.

sudo apt-get install tesseract-ocr tesseract-ocr-eng
sudo apt-get install cuneiform

At this point, setuptools needed a little extra help with the following fix:

sudo pip install setuptools --no-use-wheel --upgrade

Prerequisite development libraries are now required prior to the python binding installations:

sudo apt-get install libtiff4-dev libjpeg62-dev zlib1g-dev libfreetype6-dev liblcms-dev libwebp-dev

Finally, we install the python bindings:

sudo pip install Pillow
sudo pip install pyocr

That gets pyocr up and running on a machine.

Other libraries I’ve installed for image manipulation are as follows.

sudo apt-get install python-pythonmagick
sudo apt-get install python-pdfminer
sudo apt-get install libmagickwand-dev
sudo pip install Wand