File 'tesseract.log' is Missing (Python 2.7, Windows)
<p>I'm trying to write an OCR script with Python (2.7, Windows OS) to get text from images. First I've downloaded <a href="https://pypi.python.org/pypi/PyTesser/" rel="nofollow">PyTesser</a> and extracted it to Python27/Lib/site-packages as 'pytesser' and I've installed tesseract with <code>pip install tesseract</code> . Then I wrote the following script as self.py:</p>

<pre><code>from PIL import Image
from pytesser.pytesser import *

image_file = 'C:/Users/blabla/test.png'
im = Image.open(image_file)
text = image_to_string(im)
text = image_file_to_string(image_file)
text = image_file_to_string(image_file, graceful_errors=True)
print text
</code></pre>

<p>But I'm getting the following error:</p>

<pre><code>Traceback (most recent call last):
  File "C:/Users/blabla/self.py", line 7, in &lt;module&gt;
    text = image_file_to_string(image_file)
  File "C:\Python27\lib\site-packages\pytesser\pytesser.py", line 44, in image_file_to_string
    call_tesseract(filename, scratch_text_name_root)
  File "C:\Python27\lib\site-packages\pytesser\pytesser.py", line 24, in call_tesseract
    errors.check_for_errors()
  File "C:\Python27\lib\site-packages\pytesser\errors.py", line 10, in check_for_errors
    inf = file(logfile)
IOError: [Errno 2] No such file or directory: 'tesseract.log'
</code></pre>

<p>And yes, there's no 'tesseract.log' file anywhere. What should I do? How should I solve this problem?</p>

<p>Thank you in advance.</p>

<p>Note: I've changed the line <code>tesseract_exe_name</code> from <em>pytesser.py</em> from <strong>tesseract</strong> to <strong>C:/Python27/Lib/site-packages/pytesser/tesseract</strong> but it doesn't work.</p>

<p><strong>Edit:</strong> Alright, I've just runned <em>teseract.exe</em> that is in 'pytesser' and it created the 'tesseract.log' file but I'm still getting same error.</p>

<p>I've changed the line from <code>def check_for_errors(logfile = "tesseract.log"):</code> to <code>def check_for_errors(logfile = "C:/Python27/Lib/site-packages/pytesser/tesseract.log"):</code> in <strong>../pytesser/errors.py</strong> and it worked.</p>

python ocr tesseract