【问题标题】:Installing Python-Tesseract on a Linux system在 Linux 系统上安装 Python-Tesseract
【发布时间】:2016-03-30 05:13:03
【问题描述】:

我在我的 linux 系统上安装 python-tesseract 时遇到问题。我一直在使用本教程: http://delimitry.blogspot.be/2014/10/installing-tesseract-for-python-on.html

我得到的错误是:

 File does not exist:['/usr/include/tesseract/capi.h', '/usr/local/include/tesseract/capi.h', '/opt/include/tesseract/capi.h', '/opt/local/include/tesseract/capi.h']
root@opencv:/home/philipp/python-tesseract#

在按顺序执行其余说明后,在 /python-tesseract 中运行 python setup.py clean 时。

在这个系统上运行 linux 3.2.0-4-amd64。

Whereis tesseract-ocr 返回:

/usr/share/tesseract-ocr

Whereis leptonica 返回:

/usr/include/leptonica

Whereis tesseract 返回:

tesseract: /usr/bin/tesseract /usr/bin/X11/tesseract /usr/include/tesseract/ /usr/share/man/man1/tesseract.1.gz

我还尝试运行其他一些教程/指南来安装 python-tesseract,这些教程/指南返回了其他错误,例如缺少 libleptonica 然后缺少 libc6,但我没有对这些进行过多调查。只是想看看是否有任何其他指南立即起作用。 此外,当我在终端中运行 tesseract 时,它可以工作,但 import tesseract 没有。

我做错了什么?我该如何解决这个问题并安装 python-tesseract?

【问题讨论】:

  • 哼。我将从安装libleptonicalibc6 开始。现在,您似乎已经安装了 tesseract,但没有安装 tesseract 的 python 绑定。或者,它似乎可以通过pip 获得。
  • 你应该使用已经存在的 tesseract buildpacks 之一,就像这里解释的 stackoverflow.com/questions/53363547/…

标签: python linux runtime-error tesseract python-tesseract


【解决方案1】:

我认为这种方式对你有用:

1- 从here下载python-tesseract_0.9-0.5ubuntu3_vivid_amd64.deb

2- 安装 gdebi-core

sudo apt-get install gdebi-core

3- 使用 gdebi 安装 python-tesseract_0.9-0.5ubuntu3_vivid_amd64.deb

sudo gdebi python-tesseract_0.9-0.5ubuntu2_i386.deb

【讨论】:

  • 你能解释一下这将如何解决这个问题吗?
  • 这样,我们就可以让 python-tesseract 几乎可以工作了。剩下的就是在终端中配置环境变量 TESSDATA_PREFIX,如下所示: export TESSDATA_PREFIX=/usr/share/tesseract-ocr/ 。我在 ubuntu 14.04 上安装 python-tesseract 时遇到问题。当我尝试安装 .deb 文件时,安装存在依赖项问题,使用 gdebi-core 解决了问题,允许安装 .deb 所需的依赖项。我希望它有所帮助。
  • 你应该使用已经存在的 tesseract buildpacks 之一,就像这里解释的 stackoverflow.com/questions/53363547/…
猜你喜欢
  • 2017-01-19
  • 1970-01-01
  • 2011-06-17
  • 1970-01-01
  • 1970-01-01
  • 2021-10-07
  • 1970-01-01
  • 1970-01-01
  • 2015-06-22
相关资源
最近更新 更多