python - 安装 pytesser

标签 python python-2.7 ocr tesseract

我是 python 新手,想安装和使用 pytesser OCR 库。我安装的所有其他模块都使用了 easy_install,效果很好。但 pytesser 是我必须使用 Google Code 的 .zip 文件手动安装的第一个。

根据自述文件 (https://code.google.com/p/pytesser/wiki/README) 中的说明,我将上下文提取到我的 C:\Python27\Scripts 文件中。但是当我尝试时:

from pytesser import *

在 Python Shell 中,我收到以下错误:

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    from pytesser import *
ImportError: No module named pytesser

有什么想法吗? Windows 7。Python 2.7。我使用 PIL、S​​crapy、Numpy 等模块的其他脚本运行良好。

谢谢, 汤姆

最佳答案

我不确定这是否是理想的解决方案,但这对我有用。如果这在任何方面都不正确,请纠正我。

  1. 解压缩文件夹并将其粘贴到您的 Python2x\Lib 文件夹中
  2. 将其重命名为 pytesser(我不太确定这是否是必要的步骤)
  3. 复制 tesseract.py 文件并将其重命名为 __init__.py
  4. 打开__init__.py
  5. 将 tesseract_exe_name = "tesseract"行更改为 tesseract_exe_name = 'C:\Python27\Lib\pytesser\tesseract'

完成。

关于python - 安装 pytesser,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15567141/

相关文章:

python - 在 C++ 中估计嵌入式 python 脚本的进度

python - 嵌套函数中缺少参数(装饰器)

android - 无法从 Android 中的终端更新项目

Python Pandas 一列数据框总和

java - 使用 OCR 从图像文件中读取文本的 API

java - 如何在 Android 应用程序中使用 javaanpr?

python - 删除 Python 中用点分隔的字符串的最后一部分

python - Pandas:按行扩展数据帧,类似于 R 的 SurvSplit()

Java:未使用更新的类文件

python-2.7 - 使用 Pandas 和 NLTK 在 Python 2.7 中编码/解码数据