记录一下自己在使用tesseract途中遇到的问题
C:\Users\User-name\AppData\Local\Programs\Python\Python36\python.exe C:/Users/User-name/PycharmProjects/orc/testforpackets.py
Traceback (most recent call last):
File "C:\Users\User-name\AppData\Local\Programs\Python\Python36\lib\site-packages\pytesseract\pytesseract.py", line 260, in get_tesseract_version
[tesseract_cmd, '--version'], stderr=subprocess.STDOUT
File "C:\Users\User-name\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Users\User-name\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\User-name\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "C:\Users\User-name\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 997, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/User-name/PycharmProjects/orc/testforpackets.py", line 9, in <module>
version = pt.get_tesseract_version()
File "C:\Users\User-name\AppData\Local\Programs\Python\Python36\lib\site-packages\pytesseract\pytesseract.py", line 69, in wrapper
wrapper._result = func(*args, **kwargs)
File "C:\Users\User-name\AppData\Local\Programs\Python\Python36\lib\site-packages\pytesseract\pytesseract.py", line 264, in get_tesseract_version
raise TesseractNotFoundError()
pytesseract.pytesseract.TesseractNotFoundError: tesseract.exe is not installed or it's not in your path
Process finished with exit code 1
第一次用ide使用tesseract的时候 需要修改一下pytesseract.py中的tesseract_cmd指向的路径`这里写代码片`
/# tesseract_cmd = r’C:\Program Files\Tesseract-OCR\tesseract.exe’
tesseract_cmd = ‘tesseract.exe’
“`