[Python-Dev] Patch to distutils.msvccompiler, 2.3 branch

Thomas Heller theller at python.net
Thu Nov 27 14:50:59 EST 2003


Several people on this list (IIRC Jim, Guido, Jeremy) have been bitten
by the problem that distutils couldn't build extensions with MSVC6,
complaining that the compiler isn't installed although in fact it was
installed.

The problem always seemed to be that MSVC6 only writes the complete
registry entries which distutils requires after the GUI has been run at
least one time.

I have uploaded a patch to the latest bug report from Jim,
http://www.python.org/sf/848614, which tries to detect these incomplete
registry entries.  It works for me (having removed and installed MSVC
several times, with and without running the gui).  It would be great if
someone else would try it out and report if it works correctly - IMO it
should be commited to the 2.3 maintanance branch before 2.3.3 goes out.
(Suggestions for better wording would be accepted ;-)

The effect of this patch would be the folling outputs from a
'setup.py build_ext' command, depending on the compiler installation
state:

Not installed:

  error: Python was built with version 6 of Visual Studio, and
  extensions need to be built with the same version of the compiler, but
  it isn't installed.

Installed, but the GUI has never been run:

  warning: It seems you have Visual Studio 6 installed, but the expected
  registry settings are not present.  You must at least run the Visual
  Studio GUI once so that these entries are created.
  error: Python was built with version 6 of Visual Studio, and
  extensions need to be built with the same version of the compiler, but
  it isn't installed.

Installed, and GUI has been run: the extension should build normally.


Thanks,

Thomas




More information about the Python-Dev mailing list