This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients benjamin.peterson, lemburg, loewis, srid, tarek, zart
Date 2010-06-21.12:36:44
SpamBayes Score 5.269326e-05
Marked as misclassified No
Message-id <4C1F5CDA.4030204@egenix.com>
In-reply-to <1277122277.95.0.259500969082.issue8854@psf.upfronthosting.co.za>
Content
Konstantin Zemlyak wrote:
> 
> Konstantin Zemlyak <zart@zartsoft.ru> added the comment:
> 
> 64-bit Windows, 64-bit cmd.exe, 64-bit python, not patched::
> 
> 	D:\>"c:\Program Files\Python27\python.exe"
> 	Python 2.7rc1 (r27rc1:81787, Jun  6 2010, 20:03:36) [MSC v.1500 64 bit (AMD64)]
> 	on win32
> 	Type "help", "copyright", "credits" or "license" for more information.
> 	>>> import distutils.msvc9compiler
> 	>>> distutils.msvc9compiler.get_build_version()
> 	9.0
> 	>>> distutils.msvc9compiler.find_vcvarsall(9.0)
> 	'c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat'
> 	>>>
> 
> How did you test? Maybe it's some difference in setup.

I'm running the build process using a batch file which is
invoked through a remote shell.

Trying the same build from within a cmd.exe started locally on
the machine does not cause the error messages, so I guess this
does indeed have to do with the way the Python interpreter
is invoked.

Further inspection shows that in case the registry key is not
found, the find_vcvarsall() function uses the OS environment
to find the installation.

With the local cmd.exe, the OS environment does indeed have the
entry that points the function to the installation:

VS90COMNTOOLS

Using the remote shell, those VS2008 env vars are not set and
so the build fails.

Could you check the registry keys on your installation ?

I put these extra log lines into the find_vcvarsall() function to
see what the registry has stored:

    vsbase = VS_BASE % version
    try:
        productdir = Reg.get_value(r"%s\Setup\VC" % vsbase,
                                   "productdir")
    except KeyError:
        productdir = None

    log.info('VS2008 product dir: %s - %s' % (productdir, vsbase))

    # trying Express edition
    if productdir is None:
        vsbase = VSEXPRESS_BASE % version
        try:
            productdir = Reg.get_value(r"%s\Setup\VC" % vsbase,
                                       "productdir")
        except KeyError:
            productdir = None
            log.debug("Unable to find productdir in registry")

    log.info('VS2008 product dir: %s - %s' % (productdir, vsbase))

The output is:

VS2008 product dir: None - Software\Microsoft\VisualStudio\9.0
VS2008 product dir: None - Software\Microsoft\VCExpress\9.0
History
Date User Action Args
2010-06-21 12:36:46lemburgsetrecipients: + lemburg, loewis, benjamin.peterson, tarek, srid, zart
2010-06-21 12:36:45lemburglinkissue8854 messages
2010-06-21 12:36:44lemburgcreate