For Windows installations:
While running setup.py for package installations, Python 2.7 searches for an installed Visual Studio 2008. You can trick Python to use a newer Visual Studio by setting the correct path in VS90COMNTOOLS environment variable before calling setup.py.
Execute the following command based on the version of Visual Studio installed:
Visual Studio 2010 (VS10): SET VS90COMNTOOLS=%VS100COMNTOOLS%
Visual Studio 2012 (VS11): SET VS90COMNTOOLS=%VS110COMNTOOLS%
Visual Studio 2013 (VS12): SET VS90COMNTOOLS=%VS120COMNTOOLS%
Visual Studio 2015 (VS14): SET VS90COMNTOOLS=%VS140COMNTOOLS%
python 2.7在setup的时候查找的是VS2008编译的。如果电脑上没有这个版本的话,就按照上面说的,对应自己的版本在cmd中输入相应的指令。
注意!该命令需要在你要执行python setup.py的目录下执行。
更多参考:
http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat