#28 Win 64 issue: %1 is not a valid win32 application

4.3
closed
nobody
None
5
2012-11-25
2012-02-11
Thomas Kluyver
No

Several people are noticing this issue on Stackoverflow, e.g.:

http://stackoverflow.com/questions/9036387/cx-freeze-1-is-not-a-valid-win32-application
http://stackoverflow.com/questions/8869998/cx-freeze-dll-load-failed
http://stackoverflow.com/questions/8597126/cx-freeze-ldap-importerror-dll-load-failed-1-is-not-a-valid-win32-application
http://stackoverflow.com/questions/4676433/solving-dll-load-failed-1-is-not-a-valid-win32-application-for-pygame/4676478#4676478

They are getting the error message "ImportError: DLL load failed: %1 is not a valid Win32 application." (A couple of those links have tracebacks)

The problem seems to be related to people using 64-bit Windows, although none of the questions/answers are quite clear about what the issue/solution is. Perhaps they are getting a version mismatch between the EXE and some DLLs it loads?

Discussion

  • Andreb
    Andreb
    2012-10-15

    I also get this error when cx_freeze, Python and used DLLs are not the same bit type. Either all of these components have to be 32 bit, or all have to be 64 bit.

    Sometimes I have to work with DLLs from other companies which are usually 32 bit only. But using a 32 bit Python and a 32 bit cx_freeze works fine - regardless of my 64 bit Win7.

     
  • This problem is due to mixing 32-bit and 64-bit executables and DLL files. Make sure that all of the files are 32-bit or all of the files are 64-bit.

     


Anonymous


Cancel   Add attachments