You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Import pytesser into a script that's on a different path
2. Try and run pytesser.image_to_string()
3.
What is the expected output? What do you see instead?
This is how it crashes:
Traceback (most recent call last):
File "z:\scripts\bruker\grabMicroStar.py", line 107, in <module>
text = pytesser.image_to_string(snap).strip()
File "z:\scripts\bruker\pytesser\pytesser.py", line 41, in image_to_string
call_tesseract(scratch_image_name, scratch_text_name_root)
File "z:\scripts\bruker\pytesser\pytesser.py", line 31, in call_tesseract
proc = subprocess.Popen(args)
File "c:\programs\Python26\lib\subprocess.py", line 633, in __init__
errread, errwrite)
File "c:\programs\Python26\lib\subprocess.py", line 842, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
What version of the product are you using? On what operating system?
v0.0.1
Please provide any additional information below.
The problem is that it doesn't know where to find the tesseract.exe executable
if current working directory is not the same as that of the script (likely).
The fix is: in pytesser.py, add the following lines after tesseract_exe_name,
which figure out the path:
#=========================================
if 'pytesser' in sys.modules:
tesseract_exe_path = sys.modules['pytesser'].__path__[0]
else:
tesseract_exe_path = os.getcwd()
tesseract_exe_name = os.path.join(tesseract_exe_path,tesseract_exe_name)
#=========================================
Original issue reported on code.google.com by [email protected] on 15 Jun 2010 at 12:42
The text was updated successfully, but these errors were encountered:
in this code the line :
tesseract_exe_path = sys.modules['pytesser'].__path__[0]
return:
Traceback (most recent call last):
File "<pyshell#17>", line 1, in <module>
sys.modules['pytesser'].__path__[0]
AttributeError: 'module' object has no attribute '__path__'
Original issue reported on code.google.com by
[email protected]
on 15 Jun 2010 at 12:42The text was updated successfully, but these errors were encountered: