saideepbsd / python-tesseract

Automatically exported from code.google.com/p/python-tesseract
0 stars 0 forks source link

Tesseract DLL failed #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Steps to reproduce:
1. Install Python 2.7.3 on Windows 7 x64
2. Install python-tesseract-0.7.4.win32-py2.7.exe (as administrator)
3. Start python shell and `import tesseract`

The command line returns:
>>> import tesseract
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\tesseract.py", line 26, in <module>
    _tesseract = swig_import_helper()
  File "C:\Python27\lib\site-packages\tesseract.py", line 22, in swig_import_hel
per
    _mod = imp.load_module('_tesseract', fp, pathname, description)
ImportError: DLL load failed: The specified module could not be found.

I thought that the windows package is supposed to include a build of tesseract. 
 I haven't been able to find a tesseract.dll on my PC after installation, but 
may be looking for the wrong thing.

Original issue reported on code.google.com by lousim...@gmail.com on 1 May 2012 at 12:12

GoogleCodeExporter commented 8 years ago
Correct me if I am wrong. 

Neither Lepontica Nor Tesseract has x64 windows version. So is python-tesseract

Original comment by FreeT...@gmail.com on 2 May 2012 at 6:18

GoogleCodeExporter commented 8 years ago
You should consider installing 32bit version of python rather than 64bit in 
your already 64bit OS. 

Original comment by FreeT...@gmail.com on 8 May 2012 at 11:22

GoogleCodeExporter commented 8 years ago
I have this issue with 32bit version of python.  Python 2.7.3 (default, Apr 10 
2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32

I am able to run python-tesseract 0.7, but I get the ImportError: DLL load 
failed for _tesseract when I try to use python-tesseract 0.7.4.

I would like to upgrade to use the new CvImage to OCR without writing to disk.

Original comment by drew.wea...@gmail.com on 10 May 2012 at 1:42

GoogleCodeExporter commented 8 years ago
If u are using 64bit OS installed with 32bit Python, please try help me testing 
the following file:

http://python-tesseract.googlecode.com/files/python-tesseract-0.7.4-1.win32-py2.
7.exe

Original comment by FreeT...@gmail.com on 10 May 2012 at 8:12

GoogleCodeExporter commented 8 years ago
I still get the error with the test build.

Windows 7 64bit
Python 2.7.3 32bit

Original comment by drew.wea...@gmail.com on 10 May 2012 at 3:57

GoogleCodeExporter commented 8 years ago
Then, do me a favour. I need to find out what dlls are missing.
1) cd C:\Python27\Lib\site-packages
look for a file called _tesseract.pyd
2) download http://www.dependencywalker.com/
3) use dependency walker to determine what dlls a re missing.

Original comment by FreeT...@gmail.com on 10 May 2012 at 4:15

Attachments:

GoogleCodeExporter commented 8 years ago
Looks like there might be a few problems.

1.  opencv_core240.dll is missing a dependency for tbb.dll
2.  there are some missing files for tesseract (tesseract-dll.exe, 
tesseract302.exp and tesseract302.lib)
3.  some of the files are not in the correct directory from the installer 
(liblept168.dll, libtesseract302.dll and opencv_core240.dll)

0.7.4-1 installs the following from the python-tesseract-wininst.log:
200 File Copy: C:\Python27\liblept168.dll
200 File Copy: C:\Python27\libtesseract302.dll
200 File Copy: C:\Python27\opencv_core240.dll
200 File Copy: 
C:\Python27\Lib\site-packages\python_tesseract-tesseract-py2.7.egg-info
200 File Copy: C:\Python27\Lib\site-packages\tesseract.py
200 File Copy: C:\Python27\Lib\site-packages\_tesseract.pyd
200 File Copy: C:\Python27\Lib\site-packages\tesseract.pyc
200 File Copy: C:\Python27\Lib\site-packages\tesseract.pyo

0.7 wininst.log has:
200 File Copy: C:\Python27\Lib\site-packages\eurotext.jpg
200 File Copy: C:\Python27\Lib\site-packages\liblept168.dll
200 File Copy: C:\Python27\Lib\site-packages\libtesseract302.dll
200 File Copy: C:\Python27\Lib\site-packages\libtesseract302.exp
200 File Copy: C:\Python27\Lib\site-packages\libtesseract302.lib
200 File Copy: C:\Python27\Lib\site-packages\python_tesseract-0.7-py2.7.egg-info
200 File Copy: C:\Python27\Lib\site-packages\tesseract-dll.exe
200 File Copy: C:\Python27\Lib\site-packages\tesseract.py
200 File Copy: C:\Python27\Lib\site-packages\tesseract.pyc
200 File Copy: C:\Python27\Lib\site-packages\test.py
200 File Copy: C:\Python27\Lib\site-packages\_tesseract.pyd
200 File Copy: C:\Python27\Lib\site-packages\test.pyc
200 File Copy: C:\Python27\Lib\site-packages\tesseract.pyc
200 File Copy: C:\Python27\Lib\site-packages\test.pyo
200 File Copy: C:\Python27\Lib\site-packages\tesseract.pyo

Original comment by drew.wea...@gmail.com on 10 May 2012 at 5:10

GoogleCodeExporter commented 8 years ago
Pls confirm whether moving the three dlls into site-packages will fix the 
problem

Original comment by FreeT...@gmail.com on 10 May 2012 at 5:13

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
It is not fixed unless I add tbb.dll.  I tested with tbb.dll that was ia32 vc8. 

Original comment by drew.wea...@gmail.com on 10 May 2012 at 5:24

GoogleCodeExporter commented 8 years ago
then 4 files to site-packages?

Original comment by FreeT...@gmail.com on 10 May 2012 at 5:29

GoogleCodeExporter commented 8 years ago
Yes, those 4 files to site-packages fixes it.

Original comment by drew.wea...@gmail.com on 10 May 2012 at 5:41

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Pls help test again
http://python-tesseract.googlecode.com/files/python-tesseract-0.7.4-2.win32-py2.
7.exe

Original comment by FreeT...@gmail.com on 10 May 2012 at 6:17

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
That works for me.

Thanks for the quick response!

Original comment by drew.wea...@gmail.com on 10 May 2012 at 6:23

GoogleCodeExporter commented 8 years ago
By the way, it should not be deemed as a proper way to do it. Inside 
site-packages, there are no any dll files. 

I guess the root cause is that you didn't include C:\python27 into your %PATH%

Original comment by FreeT...@gmail.com on 10 May 2012 at 6:26

GoogleCodeExporter commented 8 years ago
I never tested with the dlls still in the C:\python27 directory after I added 
the tdd.dll.  I just did and it works.

Which means the only problem for me was the missing tdd.dll and not the 
location of the other dlls.

Original comment by drew.wea...@gmail.com on 10 May 2012 at 7:02

GoogleCodeExporter commented 8 years ago
Are u suggesting to me that I should put back all 4 dlls to c:\python27?

Original comment by FreeT...@gmail.com on 10 May 2012 at 7:07

GoogleCodeExporter commented 8 years ago
Sigh.... I need someone to buy me a coffee 

Have a nice day

Original comment by FreeT...@gmail.com on 10 May 2012 at 7:10

GoogleCodeExporter commented 8 years ago
I think it is whatever you prefer.  It works both ways for me now that I have 
tdd.dll.

Original comment by drew.wea...@gmail.com on 10 May 2012 at 7:18

GoogleCodeExporter commented 8 years ago
Pls help me check again.
http://python-tesseract.googlecode.com/files/python-tesseract-0.7.4-4.win32-py2.
7.exe

Many thanks

Original comment by FreeT...@gmail.com on 10 May 2012 at 8:17

GoogleCodeExporter commented 8 years ago
Works perfectly

Original comment by drew.wea...@gmail.com on 10 May 2012 at 8:22

GoogleCodeExporter commented 8 years ago
both example 1 and example 2 on the frontpage?

Original comment by FreeT...@gmail.com on 10 May 2012 at 8:23

GoogleCodeExporter commented 8 years ago
Yes, both examples work for me.

Original comment by drew.wea...@gmail.com on 10 May 2012 at 8:56

GoogleCodeExporter commented 8 years ago
Thanks again

Original comment by FreeT...@gmail.com on 10 May 2012 at 10:06

GoogleCodeExporter commented 8 years ago

Original comment by FreeT...@gmail.com on 10 May 2012 at 10:06

GoogleCodeExporter commented 8 years ago
I am seeing this work if importing directly from within the python console or 
when running as a script, but I'm receiving the following error when I attempt 
to run an executable built with py2exe 0.6.10:

  File "zipextimporter.pyo", line 82, in load_module
  File "tesseract.pyo", line 26, in <module>
  File "tesseract.pyo", line 18, in swig_import_helper
  File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading _tesseract.pyd

I'm using the most recent build of python-tesseract and python 2.7.2 in Windows 
7. Any ideas?

Original comment by stephen....@gmail.com on 27 Jul 2012 at 8:17