安装PIL+pytesseract
安装很简单,参考http://www.waitalone.cn/python-php-ocr.html
从http://www.lfd.uci.edu/~gohlke/pythonlibs/里面下载pillow选择自己的版本即可, 我是2.7,然而这里有个问题,明明我机子是64位的,我下载了64位的whl然后pip安装的时候居然报错了,说格式不支持,然后我就去下载32位了,居然特么的安装上了。算了....
然后
pip install pytesseract
安装成功后执行脚本:
from PIL import Image
from pytesseract import image_to_string
image = Image.open(r'7364.png') # Open image object using PIL
<pre name="code" class="python"><pre name="code" class="plain">报错,错误如下:
Traceback (most recent call last):
File "F:/spider/test.py", line 4, in <mo