Author kermode
Recipients kermode
Date 2008-04-26.17:20:21
SpamBayes Score 0.214593
Marked as misclassified No
Message-id <1209230424.66.0.154562223128.issue2698@psf.upfronthosting.co.za>
In-reply-to
Content
Python 2.6a2 on Windows XP

Distutils fails to build an extension module for MinGW. Even though 
mingw32 is specified as the compiler distutils.msvc9compiler is still 
loaded and it cannot find vcvarsall.bat. Here is an example:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

[snip]

C:\pygame\ext>path=%path%;C:\python26;C:\mingw\bin

C:\pygame\ext>set MINGW_ROOT_DIRECTORY=C:\mingw

C:\pygame\ext>python setup.py build --compiler=mingw32
running build
running build_ext
error: None

C:\pygame\ext>python setup.py build_ext --compiler=mingw32
Traceback (most recent call last):
  File "setup.py", line 6, in <module>
    ext_modules=[Extension('simple', ['simple.c',]),],
  File "C:\python26\lib\distutils\core.py", line 137, in setup
    ok = dist.parse_command_line()
  File "C:\python26\lib\distutils\dist.py", line 459, in 
parse_command_line
    args = self._parse_command_opts(parser, args)
  File "C:\python26\lib\distutils\dist.py", line 517, in 
_parse_command_opts
    cmd_class = self.get_command_class(command)
  File "C:\python26\lib\distutils\dist.py", line 836, in 
get_command_class
    __import__ (module_name)
  File "C:\python26\lib\distutils\command\build_ext.py", line 21, in 
<module>
    from distutils.msvccompiler import get_build_version
  File "C:\python26\lib\distutils\msvccompiler.py", line 658, in 
<module>
    from distutils.msvc9compiler import MSVCCompiler
  File "C:\python26\lib\distutils\msvc9compiler.py", line 286, in 
<module>
    VC_ENV = query_vcvarsall(VERSION, ARCH)
  File "C:\python26\lib\distutils\msvc9compiler.py", line 253, in 
query_vcvarsall
    raise IOError("Unable to find vcvarsall.bat")
IOError: Unable to find vcvarsall.bat

C:\pygame\ext>type setup.py
from distutils.core import setup, Extension

setup(name='Simple',
      version='1.0',
      description='Python extension module test',
      ext_modules=[Extension('simple', ['simple.c',]),],
      )


C:\pygame\ext>gcc --version
gcc (GCC) 3.4.5 (mingw special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is 
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.


C:\pygame\ext>python -V
Python 2.6a2
History
Date User Action Args
2008-04-26 17:20:25kermodesetspambayes_score: 0.214593 -> 0.214593
recipients: + kermode
2008-04-26 17:20:24kermodesetspambayes_score: 0.214593 -> 0.214593
messageid: <1209230424.66.0.154562223128.issue2698@psf.upfronthosting.co.za>
2008-04-26 17:20:23kermodelinkissue2698 messages
2008-04-26 17:20:22kermodecreate