2016-12-04 56 views
0

您可以幫我安裝Windows 7上的Python2.7的tesseract和pyteeser嗎?如何在windows7中安裝ocr引擎(tesseract)和pythonser for python2.7

下載鏈接以及如何安裝這些軟件包的詳細步驟將是首選。

我嘗試使用easy_install但它拋出一個錯誤

我裝pyteeser,也pyteeser.py文件改變import Imagefrom PIL import image

但現在我得到這個錯誤

File "C:\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 699, in runfile execfile(filename, namespace)

File "C:\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/Users/Duggentious/Documents/Python Scripts/print inspection/ocrstore.py", line 15, in text = image_to_string(im)

File "C:\Anaconda2\lib\site-packages\pytesser.py", line 31, in image_to_string call_tesseract(scratch_image_name, scratch_text_name_root)

File "C:\Anaconda2\lib\site-packages\pytesser.py", line 21, in call_tesseract proc = subprocess.Popen(args)

File "C:\Anaconda2\lib\subprocess.py", line 710, in init errread, errwrite)

File "C:\Anaconda2\lib\subprocess.py", line 958, in _execute_child startupinfo)

WindowsError: [Error 2] The system cannot find the file specified``

回答

0

試試我的嚮導 - 它可能爲你工作。

在windows上獲取pytesseract的步驟。

  1. https://www.continuum.io/downloads
  2. 安裝阿納康達2或3阿納康達從http://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-setup-4.00.00dev.exe
  3. 安裝用於Windows的tesseract所述的tesseract目錄添加到窗口作爲路徑環境變量。
  4. 安裝pytesseract例如PIP安裝pytesseract 和..

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

瞧。