【发布时间】:2020-05-05 19:14:22
【问题描述】:
我正在尝试使用 pytesseract 的 run_and_get_output 函数。但它给了我:
PermissionError: [Errno 13] Permission denied: 'C:\Users\yp270\AppData\Local\Temp\tess_0va90z8x.'
我正在使用: 蟒蛇 3.7.5 pytesseract 0.3.1 正方体 3.05.02
我试过了: 在系统环境变量中将 TESSDATA_PREFIX 设置为我的 tessdata 目录 将 pytesseract.pytesseract.tesseract_cmd 设置为我的 tesseract 可执行文件 文件
我似乎在 pytesseract 试图打开一些输出文件时出现错误 文件“C:\Users\yp270\AppData\Local\Programs\Python\Python37\lib\site-packages\pytesseract\pytesseract.py”,第 260 行,在 run_and_get_output
文件“C:\Users\yp270\AppData\Local\Programs\Python\Python37\lib\site-packages\pytesseract\pytesseract.py”,第 260 行,在
以 open(filename, 'rb') 作为 output_file:
PermissionError: [Errno 13] Permission denied: 'C:\Users\yp270\AppData\Local\Temp\tess_5nau69o0.'
但是,除此之外,它们在使用 image_to_string 、 image_to_data 、 image_to_osd 等函数时都没有问题。他们工作得很好。这个问题只出现在 run_and_get_output 函数中。
谁能说出问题出在哪里???
代码:
import pytesseract
pytesseract.pytesseract.tesseract_cmd = 'C:\\Users\\yp270\\AppData\\Local\\Tesseract-OCR\\tesseract.exe'
from PIL import Image
img = Image.open('image_path')
boxes = pytesseract.image(img)
【问题讨论】:
-
显示一些代码 Yash
-
你试过google吗?
-
我已添加代码@LV98
-
我已经尝试过 google 了,但是关于 run_and_get_output 函数的信息很少。 pytesseract github中没有与run_and_get_output相关的特殊问题
-
@Yashpatel 是否仅在您的用户 yp270 上安装了 Pytesseract?还是在
C:\Program Files也下载了?
标签: python tesseract python-tesseract