Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcc error on install of tesseract-ocr

I am trying to run the following code on my mac.

import Image
enter code here`import pytesseract
im = Image.open('test.png')
print pytesseract.image_to_string(im)

Following the question from here: pytesseract-no such file or directory error I need to install tesseract-ocr

but when I try to pip install tesseract-ocr I get the following errors:

creating build/temp.macosx-10.5-x86_64-2.7
gcc -fno-strict-aliasing -I//anaconda/include -arch x86_64 -DNDEBUG -g
-fwrapv -O3 -Wall -Wstrict-prototypes -I//anaconda/include/python2.7 -c
tesseract_ocr.cpp -o build/temp.macosx-10.5-x86_64-2.7/tesseract_ocr.o
tesseract_ocr.cpp:264:10: 
fatal error: 'leptonica/allheaders.h' file not found #include "leptonica/allheaders.h"
     ^
1 error generated.
error: command 'gcc' failed with exit status 1

I don't know what to do.

like image 986
Jase Villam Avatar asked Jan 24 '16 22:01

Jase Villam


1 Answers

You need install libtesseract-dev in your system;

sudo apt install libtesseract-dev
like image 90
yinzhedfs Avatar answered Sep 24 '22 19:09

yinzhedfs