I was creating a virtualenv with a clean install of python 3.3, 64-bit version. (Note: I have several installs of python on my computer including WinPython but want to set up clean and small virtualenvs for several projects that I am working on. The WinPython version works just fine.) When I used pip to try to install packages, I got an error message (can include pip log if requested). Ultimately, the last lines of the error message were:
File "c:python33-bLibdistutilsmsvc9compiler.py", line 287, in query_vcvarsall raise ValueError(str(list(result.keys())))
ValueError: ['path']
I investigated the results from the function query_vcvarsall in the msvc9compiler.py. I found out that this function was looking for the path of vcvarsall from MS Visual Studio 10 Express on my computer. It is looking for 4 components: INCLUDE=, PATH=, LIB=, and LIBPATH=. These were specific for MS VS 2010. My install sent an argument of "amd64" to this function. It did not find anything but the PATH= statement but it did find the vcvarsall.bat file. When I tricked this function to use the "x86" argument, it found all of the 4 statements and appeared as if it would run fine.
I spent some time researching this on the web. I found that MS VS Express 2010 installs by default as 32-bit. One has to set it to run as 64-bit (which means it will set the statements needed above.) Apparently there was a bug and the 64-bit tools were not installed with this version. So I installed MS SDK in order to install the 64-bit tools. I then found there was a fix to this and installed that (listed below in links).
There were several methods outlined to create the paths for the 64-bit VS. One was to run vcvarsall amd64
on the command line for MS VS. This resulted in a message saying the tools were not installed on my computer. These tools were to reside in the C:Program Files (x86)Microsoft Visual Studio 10.0VCinamd64
directory. The file that it apparently is looking for is vcvars64.bat (or something similar). I have the directory but not the batch file. (There was a recommendation to use the x86_amd64 method but it has all of the same issues.)
The second recommendation was to run setenv /x64
from the SDK command line. I ran that and it seemed to run correctly. However, when I went I tried to install packages via pip, I got the same error message.
My question ultimately is how to get pip running smoothly? Just to mention, yes, I did reboot before I tested pip again after each install and attempt at fixing this.
Here are some sites that helped me get this far:
1) Launching a 64-bit command prompt from Visual Studio 2010
2) Setting the Path and Environment Variables for MS VS 2010 Command-Line Builds:
http://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx
3) VS2010 Express and missing x64 compiler:
https://social.msdn.microsoft.com/Forums/en-US/e0ef4613-d90f-4eec-90db-41339ed31367/vs2010-express-and-missing-x64-compiler?forum=Vsexpressinstall
4) FIX: Visual C++ compilers are removed when you upgrade Visual Studio 2010 Professional or Visual Studio 2010 Express to Visual Studio 2010 SP1 if Windows SDK v7.1 is installed:
http://support.microsoft.com/kb/2519277
5) msvc9compiler.py: ValueError when trying to compile with VC Express: http://bugs.python.org/issue7511
See Question&Answers more detail:
os