0

Similar to ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL's are there ...

This has been 4 hours of my life, so any help is appreciated:

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

When trying to import it i get the error that concludes with:

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

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.

Thank you

Community
  • 1
  • 1
user2723494
  • 1,168
  • 2
  • 15
  • 26

1 Answers1

1

Figured this out after talking it through with others who had similar problems.

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.

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 http://www.lfd.uci.edu/~gohlke/pythonlibs/

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

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

Thank you!

user2723494
  • 1,168
  • 2
  • 15
  • 26
  • 1
    I had the same problem with my install of a 64bit python version 2.7.14. On my windows 10, 64 bit machine. I uninstalled it and reinstalled 2.7.15 and the problem has gone away. – Chai Ang Aug 24 '18 at 21:55