【发布时间】:2017-10-04 19:13:14
【问题描述】:
我正在尝试安装 tesseract,但如果我按照所有步骤操作,我仍然会收到错误消息。
Traceback (most recent call last):
File "C:\Users\julian\Documents\Schikka\tesseract.py", line 3, in <module>
print(pytesseract.image_to_string(Image.open('images/test.jpg')))
File "C:\Users\julian\AppData\Local\Programs\Python\Python35\lib\site-packages\pytesseract\pytesseract.py", line 122, in image_to_string
config=config)
File "C:\Users\julian\AppData\Local\Programs\Python\Python35\lib\site-packages\pytesseract\pytesseract.py", line 46, in run_tesseract
proc = subprocess.Popen(command, stderr=subprocess.PIPE)
File "C:\Users\julian\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 676, in __init__
restore_signals, start_new_session)
File "C:\Users\julian\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 957, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] the system cannot find the file specified.
我也尝试在 linux 上安装它,但仍然收到错误代码。
我目前有 python 3.6
这是我尝试过的代码:
from PIL import Image
import pytesseract
print(pytesseract.image_to_string(Image.open('images/test.jpg')))
请帮帮我。
【问题讨论】:
-
文件的路径可能不正确,因为 traceback 呼吁。请检查图片路径!!!
-
@Julian - 确保您的 tesseract 二进制文件与您的 py 文件位于同一文件夹中,或者位于系统路径之一中。
-
@Julian 对下面我的回答有任何反馈吗?
标签: python python-3.x ocr tesseract