安装pytesser

Tom*_* M. 9 python ocr tesseract python-2.7

我是python的新手,想安装并使用pytesser OCR库.我安装的所有其他模块,我都使用了easy_install,它运行良好.但pytesser是我第一次使用Google Code的.zip文件手动安装.

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

from pytesser import *
Run Code Online (Sandbox Code Playgroud)

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

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

有任何想法吗?Windows 7. Python 2.7.我使用PIL,Scrapy,Numpy等模块的其他脚本工作正常.

谢谢,汤姆

Yai*_*zme 10

我不确定这是否是理想的解决方案,但这对我有用.如果这是不正确的,请纠正我.

  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'

完成.

  • 另外,我必须将行导入图像更改为PIL导入图像 (2认同)
  • 我不得不将"Image"的导入更改为"来自PIL导入图像" (2认同)

wRA*_*RAR 6

您不应该使用C:\Python27\Scripts第三方模块,C:\Python27\Lib\site-packages而应该使用.

  • Linux怎么样? (2认同)