[Distutils] Binary installer on Windows can't install extension

Malte Forkel malte.forkel at berlin.de
Wed Jun 12 19:09:39 CEST 2013


Hello,

I have a problem with an install script in Python 2.7.5 on Windows 7 64-Bit.

I have written an install script to register a COM server for a
Windows-specific package. I specify the script with the --install-script
option to the bdist_wininst command.

When I run the installer, the install script fails trying to install an
extension:

Traceback (most recent call last):
  ...
  File "C:\Program
Files\Python\lib\site-packages\mx\DateTime\DateTime.py", line 9, in <module>
    from mxDateTime import *
  File "C:\Program
Files\Python\lib\site-packages\mx\DateTime\mxDateTime\__init__.py", line
13, in <module>
    raise ImportError, why
ImportError: DLL load failed: %1 is not a valid Win32 application.
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr

The last three lines of output are probably caused by a known, unrelated
issue (http://bugs.python.org/issue15321).

I can run the install script by hand without problems. Importing
mx.DateTime in Python works fine as well.

I know very litte about Windows internals, but have a guess
nevertheless: I checked mx\DateTime\mxDateTime\mxDateTime.pyd with
Dependency Walker (depends.exe). It seems, the extension does not find
the proper version of MSVCR90.DLL. Instead, it is trying to use a 32-bit
version of the DLL that was installed as part of a 32-bit application.
The application's directory is included in the user search path (PATH).
Obviously, a 64-bit version of the DLL exists and is used by Python itself.

What is causing my problem? How can I solve it?

Thanks,
Malte






More information about the Distutils-SIG mailing list