내가 화면에 어떤 수를 검출하기 위해 현재 화면의 일부를 캡처하려고하지만를 사용하는 경우 코드 실행이 오류가 왔을 때 :파이썬 FileNotFoundError pytesseract
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/bot/detect_num.py", line 12, in <module>
print(pytesseract.image_to_string(Image.open('test.jpg')))
File "C:\Python35\lib\site-packages\pytesseract\pytesseract.py", line 161, in image_to_string
config=config)
File "C:\Python35\lib\site-packages\pytesseract\pytesseract.py", line 94, in run_tesseract
stderr=subprocess.PIPE)
File "C:\Python35\lib\subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "C:\Python35\lib\subprocess.py", line 1224, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
소스 코드 :
import pyscreenshot as ImageGrab
from PIL import Image
import subprocess
from pytesseract import *
if __name__=="__main__":
im = ImageGrab.grab(bbox=(1349, 34, 1357, 45))
im = im.convert('1')
im.save('test.jpg', 'JPEG')
im.show()
print(pytesseract.image_to_string(Image.open('test.jpg')))
을
제발 말해줘, 왜 고쳐야 하나?
가능한 중복을 다운로드 할 수 있습니다
아래로, 코드에서 정팔 포체의 경로를 삽입해야합니다 : \ [오류 2 \] 시스템 지정한 파일을 찾을 수 없습니다 "해결되지 않습니다] (http://stackoverflow.com/questions/18757127/windowserror-error-2-the-system-cannot-find-the-file-specified-is-not-resol) –
나는 서브 프로세스를 호출 할 때 라인을 삭제하려고 시도했다. (다른 응답은 그것을 고치기 위해 조언한다.) 당신의 제안에 그 anwser의 라인을 추가한다.하지만 여전히 에러가 난다. @PavneetSingh – AlphaWolf