"The system cannot find the file specified" error in Spyder
<p>I am using python to solve Captcha level 1 on <a href="http://hackthis.co.uk" rel="nofollow">http://hackthis.co.uk</a></p>

<p>here is the code</p>

<pre><code>from PIL import Image
import pytesseract
import requests
from StringIO import StringIO
url = "https://www.hackthis.co.uk/levels/captcha/1"
login = "https://www.hackthis.co.uk/?login"
payload = {"username": "user", "password": "pass"}

def solve(captcha):
pytesseract.image_to_string(Image.open(captcha))
# other code needs to be writted
return "abc";    


s = requests.Session() # Start a session
s.post(login, data=payload) # Login
response = s.get(url).text # Get problem data
captcha = s.get("https://www.hackthis.co.uk/levels/extras/captcha1.php")
captcha = Image.open(StringIO(captcha.content))
captcha.save("E:/captcha1.png")
solution = solve("E:/captcha1.png")
payload = {"answer": solution}
s.post(url, data=payload) # Post data
</code></pre>

<p>But i am getting an error </p>

<p>Complete log is here <a href="http://pastebin.com/7T9aKnPN" rel="nofollow">http://pastebin.com/7T9aKnPN</a></p>

<p>If required, here is subprocess.py <a href="http://pastebin.com/zmkbhgj6" rel="nofollow">http://pastebin.com/zmkbhgj6</a></p>

<p>I tried every other solutions on other forums but none helped</p>

<p>Thanks in advance :)</p>

<p><strong>EDIT : The problem only occurs when i use the pytesseract.image_to_string() method</strong></p>

<p>Well the problem was, tesserect wasn't installed!
i downloaded this Tesserect OCR executables from <a href="https://github.com/tesseract-ocr/tesseract/wiki/Downloads" rel="nofollow">the download page</a></p>

<p>then added the downloaded directory to <code>PATH</code> variable
Installed VC2015 x86 redist (required)
Worked for me :D</p>

python spyder