I have Microsoft Visual Studio 2008 installed already. I downloaded the zip file Python for Windows extensions and extracted the contents into my Python27 folder. There\'s n
As stated it's trying to use a 32-bit compiler for 64-bit python. I was able to build successfully by:
vcvarsx86_amd64.bat
in C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64
(depends on your setup)SET VS90COMNTOOLS=%VS120COMNTOOLS%
(depends on setup, see https://stackoverflow.com/a/10558328/2362877)vcvarsx86_amd64.bat
pip install <package>
Python for Windows extensions is only supported on
32-bit MS Windows (95/98), 32-bit MS Windows (NT/2000/XP), All 32-bit MS Windows (95/98/NT/2000/XP), Win2K, WinXP, WinCE
Taken from the sourceforge project page. Seems like you may be out of luck!
EDIT: However... reading this seems to imply otherwise.
If you have a 64 bit Python installation:
Install "Microsoft Visual Studio 2008 Professional Edition" with the "X64 Compiler and Tools" option enabled.
Alternatively, download pywin32-214.win-amd64-py2.7.exe from http://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/
I tried all the other answers and a lot more. Ended up installing python 32-bit, which fixed the issue right away.
If this is an option, it's most likely the easiest fix.
Another possible reason for this problem to appear is that you have just installed Visual Studio and the command prompt you're using had been hanging around from the time before the installation.
This is because MSVC installer sets few environment variables and one of these variables ( VS90COMNTOOLS )has to be set for vcvarsall.bat to execute correctly. But each running program in Windows holds its own local copy of environment variables that gets inherited (copied) from parent process upon child start-up. Thus, after child has started, it does not receive alterations performed on the system-level envvars. And the only way of getting updated environment variables is trough spawning a new instance of a child process with parent that has updated version of envvars.
None of these answers worked for me but I found the solution on the issue tracker:
Source: http://bugs.python.org/issue7511