I have a situation very much like the one at ImportError: DLL load failed: %1 is not a valid Win32 application, but the answer there isn\'t working for me.
My Python
If your build-system (CMake in my case) copies the file from
to
, you will get this error if the original file wasn't actually a dll. In my case, building shared libraries got switched off, so the underlying file was actually a *.lib
.
I discovered this error by loading the pyd
file in DependencyWalker and finding that it wasn't valid.