[python-win32] Python 2.7.11 on Windows Server 2012 R2 standard - Error message "DLL load failed: %1 is not a valid Win32 application" after IMPORT WIN32SERVICE

Tim Roberts timr at probo.com
Sun Mar 20 23:53:58 EDT 2016


On Mar 18, 2016, at 8:48 AM, Andreas <anwohot at hotmail.com<mailto:anwohot at hotmail.com>> wrote:


I have installed Python 2.7.11 - 64bit version on a Windows Server 2012 R2 Standard (64-bit version)
...

>>> import pywintypes
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\python27\lib\site-packages\win32\lib\pywintypes.py", line 124, in <module>
    __import_pywin32_system_module__("pywintypes", globals())
  File "D:\python27\lib\site-packages\win32\lib\pywintypes.py", line 64, in __import_pywin32_system_module__
    import _win32sysloader
ImportError: DLL load failed: %1 is not a valid Win32 application.


What is the reason? How can I solve this problem?

It looks to me like you installed the 32-bit version of PyWin32.  When you have a 64-bit Python, every extension you install has to be a 64-bit extension.  Unlike the 16/32 transition, 64-bit Windows simply does not have the ability to mix 32-bit and 64-bit libraries in a single process.

It is for this reason that I still tend to choose 32-bit Python.
—
Tim Roberts, timr at probo.com<mailto:timr at probo.com>
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20160320/9a872b4f/attachment.html>


More information about the python-win32 mailing list