pytesseract Windows Error 6错误的解决办法

错误信息:

  1. Traceback (most recent call last):  
  2.   File "D:\tests\test_pytesseract.py", line 30in <module>  
  3.     print(pytesseract.image_to_string(img))  
  4.   File "C:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 164in image_to_string  
  5.     config=config)  
  6.   File "C:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 95in run_tesseract  
  7.     stderr=subprocess.PIPE,  
  8.   File "C:\Python27\lib\subprocess.py", line 702in __init__  
  9.     errread, errwrite), to_close = self._get_handles(stdin, stdout, stderr)  
  10.   File "C:\Python27\lib\subprocess.py", line 850in _get_handles  
  11.     c2pwrite = self._make_inheritable(c2pwrite)  
  12.   File "C:\Python27\lib\subprocess.py", line 884in _make_inheritable  
  13.     _subprocess.DUPLICATE_SAME_ACCESS)  
  14. WindowsError: [Error 6
解决办法:


将pytesseract的文件中:

   proc = subprocess.Popen(command,stderr=subprocess.PIPE) 

改为:

  1.  proc = subprocess.Popen(command,  
  2.             stdout=subprocess.PIPE,  
  3.             stderr=subprocess.PIPE,  
  4.             shell=True  
  5.             )  
即可。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值