[Python-Dev] VC++ 2008 Express Edition now locked away?

Steve Dower Steve.Dower at microsoft.com
Thu Mar 7 18:53:56 CET 2013


> From: Terry Reedy
> On 3/6/2013 12:29 PM, Steve Dower wrote:
> > From: Case Van Horsen
> 
> >> The "Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
> >> is still available for download. It includes the command line
> >> compilers that are used with VS 2008. I have used to create extensions for
> Python 2.6 to 3.2.
> >> There is a later version of the SDK (for .NET
> >> 4.x) that includes the compilers from VS 2010.
> >
> > This is the same response that I got internally.
> >
> > The download link is
>  > http://www.microsoft.com/en-us/download/details.aspx?id=3138
>  > and you can choose to only download and install the compilers.
> 
> The C++ compiler appears to the the full compiler that will build both
> 32 and 64 bits apps. Will downloading just the compiler(s) allow one to build
> Python with the project files in PCBuild or does something else need to be
> checked also?

Just testing this now, but 

Any version of Visual Studio (Professional or higher), OR
	Visual Studio 2012 Express for Desktop (http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-for-windows-desktop) OR
	Visual C++ 2010 Express (http://www.microsoft.com/visualstudio/en-us/express-cpp/overview) (maybe - haven't confirmed this yet)

For Python 3.3: the compilers and headers from the "Windows SDK for Windows 7 and .NET Framework 4" (http://www.microsoft.com/en-us/download/details.aspx?id=8279)
For earlier versions: the compilers and headers from the "Windows SDK for Windows 7 and .NET Framework 3.5" (http://www.microsoft.com/en-us/download/details.aspx?id=3138)
(You can install both compilers on the same machine.)

Once these compilers have been installed, VS will let you choose which one your project will use. In Project Properties there is a "Platform Toolset" list that will include all of the installed compilers. For Python 3.3, you'll want VC100, and earlier versions will want VC90.

If you open an existing project (including PCBuild.sln), VS will offer to update it. If you don't update it, and you have the earlier compilers installed, it will use them. Right now, I've only tested this with 3.3, which used a different project format to earlier versions (.vcxproj, rather than .vcproj). I assume we know how to upgrade the project files without changing the platform target, but I haven't confirmed that yet.

> >> To use the SDK compiler, you need to do a few manual steps first.
> >>
> >> After starting a command window, you need to run a batch file to
> >> configure your environment. Choose the appropriate option from
> >>
> >> C:\Program Files (x86)\Microsoft Visual Studio
> >> 9.0\VC\bin\vcvars64.bat
> >>
> >> or
> >>
> >> C:\Program Files (x86)\Microsoft Visual Studio
> >> 9.0\VC\bin\vcvars32.bat
> >>
> >> Then set two environment variables:
> >>
> >> set MSSdk=1
> >> set DISTUTILS_USE_SDK=1
> >>
> >> After these steps, the standard python setup.py install should work.
> 
> This may be fine for building extensions, but it appears that more instructions
> are needed for a novice to build python itself.

I'm not even sure that these variables are necessary - certainly without the compilers installed setup.py looks in the right place for them. I'll try this as well.

> Following the instruction in the developer's guide,
> http://docs.python.org/devguide/setup.html#windows
> I was able to download and install vc express, double click on
> <branch_dir>/PCBuild/pcbuild.sln to bring up the VS GUI, and use the menu
> to build a debug version of that branch. The new python is put in the same
> directory and can be run with another menu selection. Any alternate path
> should be that easy too.

I'll admit I'm not a huge fan of the current Windows build setup, but since so few people seem to use it I understand why it hasn't changed.

As for the documentation, I'd be happy to provide an update for this section once I've checked out that everything works.


Cheers,
Steve

> --
> Terry Jan Reedy




More information about the Python-Dev mailing list