Python - Tesseract-WindowsError: [Error 2] ?

新手上路,请多包涵

用python识别验证码,安装了PIL,pytesseract,也安装了Tesseract,但是无法运行
也设置了环境变量

#coding=utf-8
import pytesseract
import PIL
# import os
# os.chdir('C:\\Python27\\Lib\\site-packages\pytesseract')
image = PIL.Image.open('E:\\0.png')
vcode = pytesseract.image_to_string(image)
print vcode

错误提示:

C:\Python27\python.exe E:/学习/Python/test/test.py
Traceback (most recent call last):

File "E:/ѧϰ/Python/test/test.py", line 7, in <module>

vcode = pytesseract.image_to_string(image)

File "C:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 162, in image_to_string

config=config)

File "C:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 95, in run_tesseract

stderr=subprocess.PIPE)

File "C:\Python27\lib\subprocess.py", line 710, in init

errread, errwrite)

File "C:\Python27\lib\subprocess.py", line 958, in _execute_child

startupinfo)

WindowsError: [Error 2]

Process finished with exit code 1

阅读 6.1k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题