识别图片中的文本信息报错已经通过pip install pytesseract安装了相应库,如何解决?

识别图片中的文本信息报错
已经通过pip install pytesseract安装了相应库

import pytesseract
from PIL import Image
# 读取图片
im = Image.open("test.png")
# 识别文字
string = pytesseract.image_to_string(im)
print(string)


报错信息:
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'tesseract'

During handling of the above exception, another exception occurred:

没安装成功,卸载重装再试试。我猜

pytesseract.pytesseract.tesseract_cmd = './Tesseract-OCR/tesseract'

添加上这行代码试试,目录改成你自己电脑tesseract的安装目录