我是 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、Scrapy、Numpy 等模块的其他脚本运行良好。
谢谢, 汤姆
最佳答案
我不确定这是否是理想的解决方案,但这对我有用。如果这在任何方面都不正确,请纠正我。
- 解压缩文件夹并将其粘贴到您的 Python2x\Lib 文件夹中
- 将其重命名为 pytesser(我不太确定这是否是必要的步骤)
- 复制 tesseract.py 文件并将其重命名为 __init__.py
- 打开__init__.py
- 将 tesseract_exe_name = "tesseract"行更改为 tesseract_exe_name = 'C:\Python27\Lib\pytesser\tesseract'
完成。
关于python - 安装 pytesser,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15567141/