下面是我的代码
im=Image.open("/root/ppm_to_jpg/6e196d3b-adec-45ab-b036-5833f96f1bc0-2.jpg")
pytesseract.pytesseract.tesseract_cmd = r'/usr/local/bin/pytesseract'
text=pytesseract.image_to_string(im,lang="eng")
print (text)
我得到了错误提示,例如TesseractError:(2,“用法:pytesseract [-l lang] input_file”)
有人可以建议我该怎么做
答案 0 :(得分:0)
!sudo apt install tesseract-ocr
以上安装了pytesseract所需的依赖项。这非常重要,尤其是!没有它们,您将无法直接安装到基础操作系统。
!pip install pytesseract
这将安装Python绑定。
希望这会有所帮助。