Issue
When I try to execute this code, I get this error (snapshot in attached file) : # Child is launched. Close the parent's copy of those pipe. PermissionError: ][WinError 5] Access is denied ' . Is there any solution for this. Thanks.
import pytesseract
from PIL import Image
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files'
img = Image.open("one.jpg")
width, height = img.size
new_size = width*6, height*6
img = img.resize(new_size, Image.LANCZOS)
img = img.convert('L')
img = img.point(lambda x: 0 if x < 155 else 255, '1')
imagetext = pytesseract.image_to_string(img)
print (imagetext)
Solution
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files'
For sure,you can not access this file without Administrator authority.
There are two way to do this:
add your
tesseract
to your system PATH(recommend).Run the py file as Administrator.
Answered By - jizhihaoSAMA
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.