Windows7中的Python2.7如何安装OCR引擎(Tesseract)和Pyteeser



您可以帮助我在Windows 7上安装Python2.7的Tesseract和Pyteeser吗?

下载链接和详细的步骤如何安装这些软件包。

我尝试使用easy_install,但它引发了错误

我安装了Pyteeser,也将import Image更改为pyteeser.py文件中的from PIL import image

但是现在我遇到了这个错误

文件 " c: anaconda2 lib site-packages spyderlib widgets externalshell sitecustomize.py", 第699行,在Runfile中 execfile(文件名,名称空间)

文件 " c: anaconda2 lib site-packages spyderlib widgets externalshell sitecustomize.py", 第74行,在Execfile中 exec(compile(scripttext,fileName,'exec'),loc,loc)

文件" c:/users/duggentious/documents/python脚本/print 检查/ocrstore.py",第15行, text = image_to_string(im)

文件" c: anaconda2 lib lib site-packages pytesser.py",第31行,in image_to_string call_tesseract(scratch_image_name,scratch_text_name_root)

file" c: anaconda2 lib lib site-packages pytesser.py",第21行,in call_tesseract proc = subprocess.popen(args)

file" c: anaconda2 lib subprocess.py",第710行, in Init errread,errwrite)

文件" c: anaconda2 lib lib subprocess.py",第958行,in _execute_child startupinfo)

WindowsError:[错误2]系统找不到指定的文件``

尝试我的指南 - 它可能对您有用。

使pytesseract在Windows上工作的步骤。

  1. 从https://www.continuum.io/downloads
  2. 安装Anaconda 2或Anaconda 3
  3. 从http://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-setup-4.00.00.00.00dev.exe
  4. 安装Windows的Tesseract。
  5. 将Tesseract目录添加到Windows作为路径环境变量。
  6. 安装pytesseract,例如PIP安装Pytesseract和..

    import pytesseract
    from PIL import Image
    image = Image.open('example_02.png')
    code = pytesseract.image_to_string(image)
    print code
    

voila。

最新更新