pyinstaller打包自动识别数字的主程序后,pytesseract程序报错,但未打包主程序之前,程序运行正常,无报错问题。
def shibie_data(self):
'''3、识别图片中的数字'''
# text = pytesseract.image_to_string(Image.open("./save_img/test11.png",lang="eng"))
pytesseract.pytesseract.tesseract_cmd = "./Tesseract/tesseract.exe"
text = pytesseract.image_to_string(Image.open("./save_img/jiequ.png"))
print("返回坐标信息:",text)
return text