相关疑难解决方法(0)

Tesseract未找到错误

我试图在python中使用pytesseract但总是最终得到错误:

"TesseractNotFoundError:没有安装tesseract,或者它不在你的路径中"

pytesseract和tesseract安装在系统中.我是python的新手,所以如果有人可以帮助我,我将非常感激

python tesseract python-3.x python-tesseract

50
推荐指数
12
解决办法
8万
查看次数

(2, '用法: pytesseract [-l lang] input_file') 在 Google Colab 上

我正在尝试在 Google Colab 中运行 Tesseract:

!sudo apt install tesseract-ocr
!pip install pytesseract

import pytesseract
import shutil
import os
import random
try:
 from PIL import Image
except ImportError:
 import Image

from google.colab import files
uploaded = files.upload()

extractedInformation = pytesseract.image_to_string(Image.open('aaa.png'))
print(extractedInformation)
Run Code Online (Sandbox Code Playgroud)

我尝试在我正在上传的图像('aaa.png')上运行,但它运行此错误:

TesseractError: (2, 'Usage: pytesseract [-l lang] input_file')
Run Code Online (Sandbox Code Playgroud)

从几乎相同(仍未解决)的帖子中搜索,我尝试了以下代码,但仍然无法正常工作:

pytesseract.pytesseract.tesseract_cmd = (
    r'/usr/local/bin/tesseract'
)
Run Code Online (Sandbox Code Playgroud)

我尝试访问 pytesseract 文件夹,但运行此错误:

在此输入图像描述

PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/pytesseract/pytesseract.py'
Run Code Online (Sandbox Code Playgroud)

python python-tesseract google-colaboratory

4
推荐指数
1
解决办法
5672
查看次数