So I have a situation where I need to make binary patches and then be able to apply them from within python. I found bsdiff which looks like a great algorithm and has a pyth
It's a mismatch in versions of Python and pywin32. I got the same error message after installing pywin32 in a virtual environment using easy_install:
(py351env) C:\Users\ernesto.luzon\Downloads>easy_install pywin32-220.win-amd64-py3.5.exe
When I tried to import win32gui I got exactly the same error:
DLL Load Failed: %1 is not a valid win32 application
Googling for the error message led me to this post where cgohlke suggested to download the pywin32 package from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32
I downloaded the 64bit version and installed it via pip:
pip install pywin32-220-cp35-none-win_amd64.whl
Right away I got an error message that my python version does not match with the package I was trying to install. So I typed 'python' in my command line to launch the interpreter, and indeed the python installed in my 64bit machine was a 32bit python. After uninstalling python and correctly installing the 64bit one, this error disappeared, whether I use easy_install to install pywin32 from the sourceforge project, or I use pip to install the wheel file from gohlke.