title: Missing or incompatible file: ImportError: DLL load failed: %1 is not a valid Win32 application
body: <h2>Problem:</h2>
  
  <p>Getting this error when trying to import <a href="https://code.google.com/p/python-tesseract/" rel="nofollow noreferrer">python-tesseract</a> into my project (OCR functionality):</p>
  
  <p><code>ImportError: DLL load failed: %1 is not a valid Win32 application.</code></p>
  
  <ul>
  <li>I do not know what exactly the problem is</li>
  <li>I do not have the skills and knowledge to trace this kind of problem to it's root cause.</li>
  </ul>
  
  <h2>Background:</h2>
  
  <p>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 running tesseract under these conditions, but they are not ideal and could be causing this challenge.</p>
  
  <h3>Stack trace</h3>
  
  <p>This is the error trace from PyCharm. As you can see, it does not specify the file that was the problem, instead saying it could not find what looks to be string format argument: <code>%1</code></p>
  
  <pre>
  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.
  </pre>
  
  <h3>Dependency Walker</h3>
  
  <p>Ran dependency walker on the file that seems to be the problem: <code>_tesseract.pyd</code> and found a few things that seemed strange:</p>
  
  <ul>
  <li>It cannot find Python27.dll 
  
  <ul>
  <li>Even though I've been successfully using Python for a long time now.</li>
  <li>I verfified that <code>Python.dll</code> is located in <code>C:\Windows\System32</code> on my system</li>
  </ul></li>
  <li>The file <code>MSVCR90.DLL</code> is the wrong CPU version.
  
  <ul>
  <li>it is not found in an "expected" area such as <code>C:\Windows\System32</code>, but rather in the program files directory for a niche graphics library that I have installed: <code>c:\program files\graphicsmagick-1.3.18-q8\MSVCR90.DLL</code>. Could there be issues with the two installations confusing each other?</li>
  </ul></li>
  </ul>
  
  <pre>
  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.
  </pre>
  
  <p><strong>Screen shot:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/eGhO0.png" alt="enter image description here"></p>