distutils that supports msvc10 and that can be backfitted into Python 2.6

Mero ormax3 at mail.com
Mon Jul 2 05:40:10 CEST 2012


On 26/06/2012 23:24, KACVINSKY Tom wrote:
> I have need for a distutils that supports msvc10, and which can be
> back-fitted into Python 2.6.  Is there such a beast?

One trick I found was to define an environment variable *VS90COMNTOOLS*
that points to the actual VS2010 location:

    VS90COMNTOOLS=%VS100COMNTOOLS%

This is because distutils looks for VS2008 in the registry and falls
back to the env. var. above, hence we trick it to detect VS2010 and call
`vcvarsall.bat` when compiling extensions:

    python setup.py build --compiler=msvc

Just keep in mind that it is recommended that "extension modules be
compiled with the same compiler that was used to compile Python" which
is still VS2008 to this day..




More information about the Python-list mailing list