AttributeError: module 'pytesseract' has no attribute 'pytesseract'

1,670 views
Skip to first unread message

bryan lee

unread,
May 28, 2018, 12:02:13 AM5/28/18
to tesseract-ocr
Hi All, 

Help needed, i know this is very basic as i am not able to continue from here. 
I was trying to use pytesseract.
Below is what i have done:
I am using anaconda --> Jupyter notebook --> Python 3.6
First i install pytesseract
!conda install -c jim-hart pytesseract

Then i install tesseract-ocr-setup-3.02.02.exe  --> (via url: https://osdn.net/projects/sfnet_tesseract-ocr-alt/downloads/tesseract-ocr-setup-3.02.02.exe/) and install

Then i follow:
try:
    import Image
except ImportError:
    from PIL import Image
import pytesseract

pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files (x86)\\Tesseract-OCR\\tesseract'

Error i get as below:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-10-47d2996c02fd> in <module>()
----> 1 pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files (x86)\\Tesseract-OCR\\tesseract'

AttributeError: module 'pytesseract' has no attribute 'pytesseract'

Help needed.
Bryan

sett...@gmail.com

unread,
Jan 30, 2019, 1:36:03 AM1/30/19
to tesseract-ocr
Try inserting this below line, before your pytesseract code--
    pytesseract.pytesseract.tesseract_cmd = r"path to your pytesseract executabl file"

sett...@gmail.com

unread,
Jan 30, 2019, 7:05:30 AM1/30/19
to tesseract-ocr
Also put Tesseract and Pytesseract path in the environment variables


On Monday, May 28, 2018 at 9:32:13 AM UTC+5:30, bryan lee wrote:
Reply all
Reply to author
Forward
0 new messages