使用python调用pytesseract报错

D:\Software\python3.10.0\python.exe D:\svn_reptile\RPA\Strong_VPN\countries\crop_script.py 
Traceback (most recent call last):
  File "D:\svn_reptile\RPA\Strong_VPN\countries\crop_script.py", line 70, in <module>
    text = pytesseract.image_to_string(img, lang='chi_sim', config='--psm 11')
  File "D:\Software\python3.10.0\lib\site-packages\pytesseract\pytesseract.py", line 423, in image_to_string
    return {
  File "D:\Software\python3.10.0\lib\site-packages\pytesseract\pytesseract.py", line 426, in <lambda>
    Output.STRING: lambda: run_and_get_output(*args),
  File "D:\Software\python3.10.0\lib\site-packages\pytesseract\pytesseract.py", line 288, in run_and_get_output
    run_tesseract(**kwargs)
  File "D:\Software\python3.10.0\lib\site-packages\pytesseract\pytesseract.py", line 255, in run_tesseract
    proc = subprocess.Popen(cmd_args, **subprocess_args())
  File "D:\Software\python3.10.0\lib\subprocess.py", line 966, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "D:\Software\python3.10.0\lib\subprocess.py", line 1435, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
PermissionError: [WinError 5] 拒绝访问。

Process finished with exit code 1
 

报错情况很棘手,我已经重新安装了tesseract到了电脑不同文件夹,然后配置了环境变量和系统变量,在cmd都可以顺利识别,但是唯独在python就调用不了,在pytesseract的第三方库也指明了cmd程序路径了,管理员权限也打开了

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值