python - Not Found Error in Pytesser3 -
import pytesser3 import image = image.open("c:\\users\\dell\\desktop\\test.png") b = pytesser3.image_to_string(a) print(b)
i tried make simple ocr program whenever run following error. have uninstalled pytesser3 , reinstalled nothing has changed. doing wrong?
traceback (most recent call last): file "c:/users/dell/desktop/crossword.py", line 4, in <module> b = pytesser3.image_to_string(a) file "c:\users\dell\appdata\local\programs\python\python36-32\lib\site- packages\pytesser3\__init__.py", line 30, in image_to_string call_tesseract(scratch_image_name, scratch_text_name_root) file "c:\users\dell\appdata\local\programs\python\python36-32\lib\site- packages\pytesser3\__init__.py", line 20, in call_tesseract proc = subprocess.popen(args) file "c:\users\dell\appdata\local\programs\python\python36-32\lib\subprocess.py", line 707, in __init__ restore_signals, start_new_session) file "c:\users\dell\appdata\local\programs\python\python36-32\lib\subprocess.py", line 990, in _execute_child startupinfo) filenotfounderror: [winerror 2] system cannot find file specified:
here test.png: https://i.stack.imgur.com/nbjbc.png
import pytesser3 import image import pytesseract pytesseract.pytesseract.tesseract_cmd = 'c:\\users\\dell\\appdata\\local\\programs\\python\\python36-32\\lib\\site-packages\\pytesseract' = image.open("c:\\users\\dell\\desktop\\test.png") b = pytesseract.image_to_string(a) print(b)
i did said i've got different error:
traceback (most recent call last): file "c:/users/dell/desktop/crossword.py", line 6, in <module> b = pytesseract.image_to_string(a) file "c:\users\dell\appdata\local\programs\python\python36-32\lib\site-packages\pytesseract\pytesseract.py", line 122, in image_to_string config=config) file "c:\users\dell\appdata\local\programs\python\python36-32\lib\site-packages\pytesseract\pytesseract.py", line 46, in run_tesseract proc = subprocess.popen(command, stderr=subprocess.pipe) file "c:\users\dell\appdata\local\programs\python\python36-32\lib\subprocess.py", line 707, in __init__ restore_signals, start_new_session) file "c:\users\dell\appdata\local\programs\python\python36-32\lib\subprocess.py", line 990, in _execute_child startupinfo) permissionerror: [winerror 5] access denied.
you have declare pytesseract path:
import pytesseract pytesseract.pytesseract.tesseract_cmd = 'c:/program files (x86)/tesseract- ocr/tesseract'
Comments
Post a Comment