Reputation: 295
while trying to get my script to run, I am having issues with Pytesseract. I have installed through pip and installed the exe file. However, when trying to run following simplified code:
import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract.exe'
text = pytesseract.image_to_string(rotated_image)
I am constantly plagued by following error code:
OSError: [WinError 740] The requested operation requires elevation
I have admin rights over my laptop but am not the main account. Any help would be much appreciated.
Upvotes: 2
Views: 992
Reputation: 12672
I can just use this code to use tesseract
without setting the path.
import pytesseract
result = pytesseract.image_to_string("./important/aaa.jpg")
print(result)
Because I add tesseract
folder to System PATH.
You have installed tesseract
in your C:\Program Files (x86)
.This directory can not be access easily without Administrator permission.
So now,If you don't want to run this code as Administrator,you can just
add the folder of tesseract
to your system PATH.
Did you get it?
Upvotes: 1
Reputation: 5330
Run the terminal or the IDE as administrator.
Then the error about OSError: [WinError 740] The requested operation requires elevation
should be gone.
Upvotes: 1