gpt4 book ai didi

python - 使用 Pytesser 时出错 :**[WinError 2] The system cannot find the file specified**

转载 作者:太空狗 更新时间:2023-10-30 00:29:32 25 4
gpt4 key购买 nike

我收到此错误:[WinError 2] 系统找不到指定的文件,仅当我使用 pytesser 进行 OCR 时。这是我的代码片段。

from PIL import Image
from pytesseract import *
image = Image.open('pranav.jpg')
print (image_to_string(image))****

否则,当我使用 PIL 更改图像大小时,我不会收到此错误。

最佳答案

您不必编辑任何 pytesseract 文件。您可以像这样在代码中声明 Tesseract 安装路径:

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

关于python - 使用 Pytesser 时出错 :**[WinError 2] The system cannot find the file specified**,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31217647/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com