title: ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL's are there
body: <p>I have a situation very much like the one at <em><a href="https://stackoverflow.com/questions/14629818/importerror-dll-load-failed-1-is-not-a-valid-win32-application">Error &quot;ImportError: DLL load failed: %1 is not a valid Win32 application&quot;</a></em>, but the answer there isn't working for me.</p>
  <p>My Python code says:</p>
  <pre><code>import cv2
  </code></pre>
  <p>But that line throws the error shown in the title of this question.</p>
  <p>I have OpenCV installed in <code>C:\lib\opencv</code> on this 64-bit machine. I'm using 64-bit Python.</p>
  <p>My PYTHONPATH variable: <code>PYTHONPATH=C:\lib\opencv\build\python\2.7</code>. This folder contains <code>cv2.pyd</code> and that's all.</p>
  <p>My PATH variable: <code>Path=%OPENCV_DIR%\bin;...</code> This folder contains 39 DLL files such as <code>opencv_core246d.dll</code>.</p>
  <p>OPENCV_DIR has this value: <code>OPENCV_DIR=C:\lib\opencv\build\x64\vc11</code>.</p>
  <p>The solution at <em><a href="https://stackoverflow.com/questions/14629818/importerror-dll-load-failed-1-is-not-a-valid-win32-application">Error &quot;ImportError: DLL load failed: %1 is not a valid Win32 application&quot;</a></em> says to add &quot;the new opencv binaries path (<code>C:\opencv\build\bin\Release</code>) to the Windows PATH environment variable&quot;. But as shown above, I already have the OpenCV binaries folder (<code>C:\lib\opencv\build\x64\vc11\bin</code>) in my PATH. And my OpenCV installation doesn't have any Release folders (except for an empty one under <em>build/java</em>).</p>
  <p>What's going wrong? Can I tell Python to verbosely trace the loading process? Exactly what DLL files is it looking for?</p>
  <p>I noticed that, according to <a href="http://www.dependencywalker.com/" rel="nofollow noreferrer">http://www.dependencywalker.com/</a>, the <code>cv2.pyd</code> in <code>C:\lib\opencv\build\python\2.7</code> is 32-bit, whereas the machine and the Python I'm running are 64-bit. Could that be the problem? And if so, where can I find a 64-bit version of cv2.pyd?</p>