title: WinError 5:Access denied PyTesseract
body: <p>I know this question has already been answered on this site, however, none of the solutions I looke up the internet seemed to work. Here's what I tried:</p>
  
  <ul>
  <li>Giving all permissions to my python file</li>
  <li>Changing PATH variable to point to my tesseract folder</li>
  <li>Running IDLE as administrator and then executing the file from there</li>
  </ul>
  
  <p>This error is quite bothering me now and I can't advance any further because of it.</p>
  
  <p>Here's my code if that's going to help:</p>
  
  <pre><code>import pytesseract
  import sys
  import argparse
  try:
      import Image
  except ImportError:
      from PIL import Image
  from subprocess import check_output
  pytesseract.pytesseract.tesseract_cmd = 'C:\Program Files\Tesseract-OCR'
  c=pytesseract.image_to_string(Image.open('img.png'))
  print(c)
  </code></pre>
  
  <p>Traceback:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\Hp\Desktop\bot.py", line 12, in &lt;module&gt;
      c=pytesseract.image_to_string(Image.open('captcha.png'))
    File "C:\Python\lib\site-packages\pytesseract\pytesseract.py", line 122, in image_to_string
  config=config)
    File "C:\Python\lib\site-packages\pytesseract\pytesseract.py", line 46, in run_tesseract
  proc = subprocess.Popen(command, stderr=subprocess.PIPE)
    File "C:\Python\lib\subprocess.py", line 707, in __init__
  restore_signals, start_new_session)
    File "C:\Python\lib\subprocess.py", line 992, in _execute_child
  startupinfo)
  PermissionError: [WinError 5] Accès refusé
  </code></pre>