DLL Load failed: %1 is not a valid Win32 Application for StatsModel
<p>Similar to <a href="http://stackoverflow.com/questions/19019720/importerror-dll-load-failed-1-is-not-a-valid-win32-application-but-the-dlls">ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL&#39;s are there</a>
...</p>

<p>This has been 4 hours of my life, so any help is appreciated: </p>

<p>I'm running Python 2.7.12 :: Anaconda 4.2.0 (64-bit) and trying to import statsmodels</p>

<p>When trying to import it i get the error that concludes with: </p>

<pre><code>ImportError: DLL load failed: %1 is not a valid Win32 application.
</code></pre>

<p>I've tried verifying that all versions are the same bit-levels, I've tried uninstalling and reinstalling statsmodels from CMD, I've tried installing .exe binaries from the statsmodels site for both 32 and 64, I've tried installing the model from .whl, and I've tried updating all the dependencies. Oh I also tried adding a system PATH referencing the libraries. </p>

<p>Thank you</p>

<p>Figured this out after talking it through with others who had similar problems. </p>

<p>Don't know if these steps were necessary but, to be sure I uninstalled Python then specifically reinstalled the 64 bit version. Then I uninstalled Anacondas and reinstalled specifically the 64 bit version. Note I believe Python defaults to a 32 bit version. </p>

<p>Then, despite reinstalling Anaconda, I still had the same error. So, for every package that I was getting an error from, I installed the package out of 
<a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/" rel="nofollow">http://www.lfd.uci.edu/~gohlke/pythonlibs/</a></p>

<p>So for me personally, I was throwing an error from statsmodels, so I installed it out of the above link. </p>

<p>Installation method is
1) Download correct file from above link
2) open CMD, type <code>pip install</code> then drag the file from the downloads folder into the CMD, and hit enter</p>

<p>Thank you!</p>

python dll statsmodels