Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tesseract DLL failed #19

Closed
GoogleCodeExporter opened this issue May 29, 2015 · 28 comments
Closed

Tesseract DLL failed #19

GoogleCodeExporter opened this issue May 29, 2015 · 28 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: WontFix

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

then 4 files to site-packages?

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

@GoogleCodeExporter
Copy link
Author

Yes, those 4 files to site-packages fixes it.

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

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

That works for me.

Thanks for the quick response!


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

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

Works perfectly

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

@GoogleCodeExporter
Copy link
Author

both example 1 and example 2 on the frontpage?

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

@GoogleCodeExporter
Copy link
Author

Yes, both examples work for me.

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

@GoogleCodeExporter
Copy link
Author

Thanks again

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

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Done

@GoogleCodeExporter
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant