电脑mac本地,楼主本来想用下面这段代码识别一个图片中的数字:
import pytesseract
from PIL import Image
img = Image.open('/Users/liangmimi/Desktop/11.png')
a = pytesseract.image_to_string(img, config='--psm 6')
print(a)
1. pip install pytesseract成功后运行上面的代码,报错没有tesseract
Traceback (most recent call last):
File "/Users/User/Environments/testEnv/testTess.py", line 26, in <module>
i = pytesseract.image_to_string(img)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 122, in image_to_string
config=config)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 46, in run_tesseract
proc = subprocess.Popen(command, stderr=subprocess.PIPE)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python