Python 如何在colab中使用pytesseract从图像中提取文本?

Python 如何在colab中使用pytesseract从图像中提取文本?,python,ocr,google-colaboratory,Python,Ocr,Google Colaboratory,当我试图在colab中使用pytesseract时,我遇到了这个错误 我不知道如何解决这个问题。我还使用pip install tesseract安装。但它不起作用 有人知道如何解决这个问题吗? 或者您还有其他python库OCR吗 FileNotFoundError: [Errno 2] No such file or directory: 'tesseract': 'tesseract' During handling of the above exception, another exc

当我试图在colab中使用pytesseract时,我遇到了这个错误

我不知道如何解决这个问题。我还使用pip install tesseract安装。但它不起作用

有人知道如何解决这个问题吗? 或者您还有其他python库OCR吗

FileNotFoundError: [Errno 2] No such file or directory: 'tesseract': 'tesseract'

During handling of the above exception, another exception occurred:

TesseractNotFoundError                    Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/pytesseract/pytesseract.py in run_tesseract(input_filename, output_filename_base, extension, lang, config, nice, timeout)
    257         if e.errno != ENOENT:
    258             raise e
--> 259         raise TesseractNotFoundError()
    260 
    261     with timeout_manager(proc, timeout) as error_string:

TesseractNotFoundError: tesseract is not installed or it's not in your PATH. See README file for more information.
这是我的密码。我正在试着找出那个号码

import pytesseract
roi = img[ymin:ymax, xmin:xmax]
text = pytesseract.image_to_string(roi, lang='eng')


如果未安装PyteSeract,此代码将在colab中工作

!sudo apt install tesseract-ocr
!pip install pytesseract
import pytesseract
from PIL import Image
text = pytesseract.image_to_string(Image.open('/path'))
print(text)

你能在问题中包含你正在运行的代码吗?hi@KnowledgeGainer,我刚刚上传了它。你能检查一下吗?