"The system cannot find the file specified" Spyder 中的错误

"The system cannot find the file specified" error in Spyder

我正在使用 python 解决 http://hackthis.co.uk

上的验证码级别 1

这是代码

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

但是我收到一个错误

完整日志在这里http://pastebin.com/7T9aKnPN

如果需要,这里是subprocess.pyhttp://pastebin.com/zmkbhgj6

我在其他论坛上尝试了所有其他解决方案,但 none 有帮助

提前致谢:)

编辑:只有当我使用 pytesseract.image_to_string() 方法时才会出现问题

问题是,tesserect 没有安装! 我从 the download page

下载了这个 Tesserect OCR 可执行文件

然后将下载的目录添加到PATH变量 已安装 VC2015 x86 redist(必需) 为我工作 :D