Sarkal / python-tesseract

Automatically exported from code.google.com/p/python-tesseract
0 stars 0 forks source link

tesseract has no attribute pixRead #69

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
tesseract.pixRead is throwing me the following error

import tesseract
pixImage=tesseract.pixRead(mImgFile)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'pixRead'

I am running Ubuntu Precise and I followed the instructions here: 
https://code.google.com/p/python-tesseract/wiki/HowToInstallPythonTesseractDeb

wget 
http://python-tesseract.googlecode.com/files/python-tesseract_0.7-1.4_amd64.deb
sudo apt-get install tesseract-ocr
sudo dpkg -i python-tesseract_0.7-1.4_amd64.deb
sudo apt-get -f install

when I inspect the tesseract object via pdb, I get the following: 

(Pdb) p dir(tesseract)
['GetUTF8Text', 'JUSTIFICATION_CENTER', 'JUSTIFICATION_LEFT', 
'JUSTIFICATION_RIGHT', 'JUSTIFICATION_UNKNOWN', 'MAX_NUM_INT_FEATURES', 
'OEM_CUBE_ONLY', 'OEM_DEFAULT', 'OEM_TESSERACT_CUBE_COMBINED', 
'OEM_TESSERACT_ONLY', 'ORIENTATION_PAGE_DOWN', 'ORIENTATION_PAGE_LEFT', 
'ORIENTATION_PAGE_RIGHT', 'ORIENTATION_PAGE_UP', 'PSM_AUTO', 'PSM_AUTO_ONLY', 
'PSM_AUTO_OSD', 'PSM_CIRCLE_WORD', 'PSM_COUNT', 'PSM_OSD_ONLY', 
'PSM_SINGLE_BLOCK', 'PSM_SINGLE_BLOCK_VERT_TEXT', 'PSM_SINGLE_CHAR', 
'PSM_SINGLE_COLUMN', 'PSM_SINGLE_LINE', 'PSM_SINGLE_WORD', 'PTIsImageType', 
'PTIsLineType', 'PTIsTextType', 'PT_CAPTION_TEXT', 'PT_COUNT', 'PT_EQUATION', 
'PT_FLOWING_IMAGE', 'PT_FLOWING_TEXT', 'PT_HEADING_IMAGE', 'PT_HEADING_TEXT', 
'PT_HORZ_LINE', 'PT_INLINE_EQUATION', 'PT_NOISE', 'PT_PULLOUT_IMAGE', 
'PT_PULLOUT_TEXT', 'PT_TABLE', 'PT_UNKNOWN', 'PT_VERTICAL_TEXT', 
'PT_VERT_LINE', 'ProcessPagesBuffer', 'ProcessPagesFileStream', 
'ProcessPagesPix', 'ProcessPagesRaw', 'ProcessPagesWrapper', 'RIL_BLOCK', 
'RIL_PARA', 'RIL_SYMBOL', 'RIL_TEXTLINE', 'RIL_WORD', 'SetCvImage', 
'SetVariable', 'TEXTLINE_ORDER_LEFT_TO_RIGHT', 'TEXTLINE_ORDER_RIGHT_TO_LEFT', 
'TEXTLINE_ORDER_TOP_TO_BOTTOM', 'TessBaseAPI', 'TessBaseAPI_DeleteBlockList', 
'TessBaseAPI_FindRowForBox', 'TessBaseAPI_MakeTBLOB', 
'TessBaseAPI_MakeTessOCRRow', 'TessBaseAPI_NormalizeTBLOB', 
'TessBaseAPI_Version', 'TessBaseAPI_swigregister', 
'WRITING_DIRECTION_LEFT_TO_RIGHT', 'WRITING_DIRECTION_RIGHT_TO_LEFT', 
'WRITING_DIRECTION_TOP_TO_BOTTOM', '__builtins__', '__doc__', '__file__', 
'__name__', '__package__', '_newclass', '_object', '_swig_getattr', 
'_swig_property', '_swig_repr', '_swig_setattr', '_swig_setattr_nondynamic', 
'_tesseract', 'cvar', 'isLibLept', 'isLibTiff', 'kPointsPerInch', 'suck']
(Pdb) 

Original issue reported on code.google.com by will...@gmail.com on 30 Oct 2014 at 8:45

GoogleCodeExporter commented 8 years ago
Can you update your ubuntu to at least trusty?

Original comment by FreeT...@gmail.com on 3 Nov 2014 at 2:02

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Confirms the issue in Ubuntu Precise
$tesseract -v
tesseract 3.02.02
 leptonica-1.69
  libjpeg 8b : libpng 1.2.46 : libtiff 3.9.5 : zlib 1.2.3.4

$ python 
Python 2.7.3 (default, Dec 18 2014, 19:10:20) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tesseract
>>> pixImage=tesseract.pixRead(mImgFile)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'pixRead'
>>> 

Original comment by mithu.s...@gmail.com on 21 Jan 2015 at 6:33

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
https://bitbucket.org/3togo/python-tesseract/downloads/python-tesseract_0.9-1_pr
ecise_amd64.deb

or 
sudo apt-get install python-distutils-extra tesseract-ocr tesseract-ocr-eng 
libopencv-dev libtesseract-dev libleptonica-dev python-all-dev swig libcv-dev 
python-opencv python-numpy python-setuptools build-essential subversion
svn checkout http://python-tesseract.googlecode.com/svn/trunk/src@690 
python-tesseract
cd python-tesseract
python config.py
python setup.py clean
python setup.py build
python setup.py install --user

Original comment by FreeT...@gmail.com on 22 Jan 2015 at 5:06

GoogleCodeExporter commented 8 years ago
Mac OS X 10.10.2

$ tesseract -v
tesseract 3.03
 leptonica-1.71
  libjpeg 8d : libpng 1.6.17 : libtiff 4.0.3 : zlib 1.2.5

Python 2.7.9 (default, Mar 18 2015, 20:33:05) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tesseract

>>> mImgFile = "4-33 2.jpg"
>>> pixImage=tesseract.pixRead(mImgFile)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'pixRead'

Original comment by sLeepo...@gmail.com on 18 May 2015 at 9:40

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Already install following instructions in Issue 68

Original comment by sLeepo...@gmail.com on 18 May 2015 at 9:45