Missing or incompatible file: ImportError: Error loading DLL:% 1 is not a valid Win32 application

Problem:

Getting this error while trying to import python-tesseract into my project (OCR function):

ImportError: DLL load failed: %1 is not a valid Win32 application.

  • I do not know what's the problem.
  • I do not have the skills and knowledge to trace this problem with its root cause.

History:

As I understand it, tesseract is a 32-bit application. I am running Windows 7, 64 bit with 64 bit python. Other people seemed to be managing tesseract in these conditions, but they are not ideal and can cause this problem.

Stack trace

This is an error trace from PyCharm. As you can see, it does not indicate the file that was the problem; instead, it says that it cannot find what looks like an argument of string format:%1

Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 2.7.3\helpers\pydev\pydevd.py", line 1481, in 
    debugger.run(setup['file'], None, None)
  File "C:\Program Files (x86)\JetBrains\PyCharm 2.7.3\helpers\pydev\pydevd.py", line 1124, in run
    pydev_imports.execfile(file, globals, locals) #execute the script
  File "C:/Dropbox/COC/automate/coc_automate/python/__init__.py", line 7, in 
    import tesseract
  File "C:\Python27\lib\site-packages\tesseract.py", line 28, in 
    _tesseract = swig_import_helper()
  File "C:\Python27\lib\site-packages\tesseract.py", line 22, in swig_import_helper
    _mod = imp.load_module('_tesseract', fp, pathname, description)
ImportError: DLL load failed: %1 is not a valid Win32 application.

Ran , : _tesseract.pyd , :

  • Python27.dll
    • Python .
    • , Python.dll C:\Windows\System32
  • MSVCR90.DLL .
    • "" , C:\Windows\System32, , : c:\program files\graphicsmagick-1.3.18-q8\MSVCR90.DLL. , ?
PYTHON27.DLL Error opening file.            The system cannot find the file specified (2).
API-MS-WIN-CORE-COM-L1-1-0.DLL              The system cannot find the file specified (2).   
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL      The system cannot find the file specified (2).
API-MS-WIN-CORE-WINRT-L1-1-0.DLL            The system cannot find the file specified (2).
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL   The system cannot find the file specified (2).
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL     The system cannot find the file specified (2).
API-MS-WIN-SHCORE-SCALING-L1-1-0.DLL        The system cannot find the file specified (2).
DCOMP.DLL                                   The system cannot find the file specified (2).
GPSVC.DLL                                   The system cannot find the file specified (2).
IESHIMS.DLL                                 The system cannot find the file specified (2).
...
c:\program files\graphicsmagick-1.3.18-q8\MSVCR90.DLL (Seems to be the wrong CPU version)


Error: At least one required implicit or forwarded dependency was not found.
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

:

enter image description here

+4
1

MSVCR90.DLL Visual ++ 2008. , : http://www.microsoft.com/en-us/download/details.aspx?id=15336

, python-tesseract :

Windows, VS2008, !

, - , msv++ 2008, . , , , python , python script.

+2

All Articles