在python

时间:2015-11-21 02:39:29

标签: windows python-2.7 pytesser

我是一个完整的代码新手。我正在尝试自学python,到目前为止我已经能够做基本的脚本了。我想尝试学习如何使用对我来说有点先进的OCR,但我这样做很有趣,所以我一直都在世界上。

我正在尝试设置pytesser,我知道我需要下载pytesser模块和PIL。我认为我存储文件的方式存在问题。

现在我的PIL目录位于: C:\ Python27 \ LIB \站点包

和我的pytesser_v0.01目录位于:C:\ Python27 \ Lib \ site-packages

我尝试进行基本测试here

我一直收到以下错误

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

我认为这是一个非常简单的问题,因为我一直在寻找安装我的PIL和pytesser目录的位置,每个在线论坛/帮助首先说“安装它”而不是在哪里。

编辑:

我找到了安装pytesser的正确位置,但现在我收到以下错误。第一个问题是通过确保pytesser,util,errors和tesseract.exe在site-package文件中并且程序不必进入pytesser文件夹来解决的。

>>> image = Image.open('fnord.tif')
>>> print image_to_string(image)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\pytesser.py", line 30, in   image_to_string
    util.image_to_scratch(im, scratch_image_name)
  File "C:\Python27\lib\site-packages\util.py", line 7, in image_to_scratch
im.save(scratch_image_name, dpi=(200,200))
  File "C:\Python27\lib\site-packages\PIL\Image.py", line 1433, in save
    fp = __builtin__.open(fp, "wb")
IOError: [Errno 13] Permission denied: 'temp.bmp' 

0 个答案:

没有答案