I have Microsoft Visual Studio 2008 on Windows/XP. I am trying to install a Python package that has a C extension. Normally, you type “setup.py install” to do this interactively.
The problem I have is this: If I type “setup.py install” at the cmd prompt, it shows me the compilation error like this:
creating build\temp.win32-2.7\Release\src
c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\include -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC /Tcsrc/PixCte_FixY.c /Fobuild\temp.win32-2.7\Release\src/PixCte_FixY.obj PixCte_FixY.c
c:\python27\include\pyconfig.h(227) : fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
error: command '"c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' failed with exit status 2
But if I type “setup.py install > logfile 2>&1”, the log file says
building 'acstools.PixCte_FixY' extension
c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\include -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC /Tcsrc/PixCte_FixY.c /Fobuild\temp.win32-2.7\Release\src/PixCte_FixY.obj
error: command '"c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' failed with exit status 2
So it reported that the compilation failed, but not a clue about what the problem was.
So, my question is: How can I collect the complete compiler output into a file?
I guess there is no good answer. I happened across this workaround:
I used this python program:
I named it “runsetup.py”. Now instead of “setup.py install” I use “runsetup.py install”. Somehow, cl.exe sees something different about its environment and actually prints all the error messages.