0

这是我运行时的代码,它给出了一个错误,它没有在windows中设置变量,但是它已安装,还有traindata,stackoverflow和github上的解决方案看了看,那里有一些想法,但他们没有帮助我!

image = Image.open(create_path)
print(pytesseract.image_to_string(image))

错误:

Traceback (most recent call last):
  File "D:\Dev\Scripts\NewYorkCase__upwork__\new.py", line 60, in <module>
    main(driver, main_url)
  File "D:\Dev\Scripts\NewYorkCase__upwork__\new.py", line 53, in main
    get_ready_captcha = captcha_symbols_recognized(get_path)
  File "D:\Dev\Scripts\NewYorkCase__upwork__\new.py", line 40, in captcha_symbols_recognized
    print(pytesseract.image_to_string(image))
  File "C:\Users\PANDEMIC\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pytesseract\pytesseract.py", line 294, in image_to_string
    return run_and_get_output(*args)
  File "C:\Users\PANDEMIC\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pytesseract\pytesseract.py", line 202, in run_and_get_output
    run_tesseract(**kwargs)
  File "C:\Users\PANDEMIC\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pytesseract\pytesseract.py", line 178, in run_tesseract
    raise TesseractError(status_code, get_errors(error_string))
pytesseract.pytesseract.TesseractError: (1, 'Error opening data file \\Program Files (x86)\\Tesseract-OCR\\eng.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language \'eng\' Tesseract couldn\'t load any languages! Could not initialize tesseract.')
4

0 回答 0