1

the script contains:

import win32api

When I run it, it gives me an error message “ImportError: DLL load failed: %1 is not a valid Win32 application.”

I googled it and do accordingly whatever found including downloaded and installed from http://sourceforge.net/projects/pywin32/, and also moved both files ‘pywintypes27.dll’ and ‘pythoncom27.dll’ to disk location c:\Python27\Lib\site-packages\win32. However the problem persists.

What can I do to have it working?

thanks.

Mark K
  • 8,767
  • 14
  • 58
  • 118
  • *Which* answers have you searched? [This one](http://stackoverflow.com/questions/14629818/importerror-dll-load-failed-1-is-not-a-valid-win32-application)? [This one](http://stackoverflow.com/questions/19019720/importerror-dll-load-failed-1-is-not-a-valid-win32-application-but-the-dlls)? – jonrsharpe May 14 '14 at 09:39
  • did you install win32api using the setup.py file you downloaded? – Vasili Syrakis May 14 '14 at 09:41

1 Answers1

0

thansk jonrsharpe and Vasili Syrakis for the helps.

it's strange. I turned my computer off and on again. Found other modules involved scripts also return the same error message.

I uninstalled and re-installed Python 27 (Active Python). the problem disappeared...

Mark K
  • 8,767
  • 14
  • 58
  • 118