Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
201 views
in Technique[技术] by (71.8m points)

python - Installing pytesser

I'm new to python and would like to install and use the pytesser OCR library. All of the other modules that I've installed, I've used easy_install, which has worked fine. But pytesser is the first that I've had to install by hand using Google Code's .zip file.

Per the instructions in the readme (https://code.google.com/p/pytesser/wiki/README) I extracted the contexts to my C:Python27Scripts file. However when I try:

from pytesser import *

within the Python Shell, I get the following error:

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    from pytesser import *
ImportError: No module named pytesser

Any ideas? Windows 7. Python 2.7. My other scripts using modules such as PIL, Scrapy, Numpy have been working fine.

Thanks, Tom

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I'm not sure if this is the ideal solution, but this works for me. Please do correct me if this is incorrect in any way.

  1. Unzip the folder & paste it in your Python2xLib folder
  2. Rename it to pytesser (I'm not too sure if this is a necessary step)
  3. Duplicate the tesseract.py file and rename it as __init__.py
  4. Open __init__.py
  5. Change the line tesseract_exe_name = "tesseract" to tesseract_exe_name = 'C:Python27Libpytesseresseract'

Done.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...