The solution to this problem is to set the following environment variable:
VS90COMNTOOLS
For instance:
set VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools
This error can be caused by not rebooting after installing Visual Studios, or not starting a new command prompt after installing.
Also the version of Visual Studios you can use to compile the extensions may depend on the version of python you are building for.