from:http://stackoverflow.com/questions/26140192/microsoft-visual-c-compiler-for-python-2-7
question:
I downloaded Microsoft Visual C++ Compiler for Python 2.7 , and install it, the full path of
vcvarsall.bat
is:
1 C:\Users\UserName\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.batBut the following code can’t return the path of it:
12 from distutils import msvc9compilermsvc9compiler.find_vcvarsall(9.0)The installer doesn’t write the install information to the registry, and from the source code of
find_vcvarsall()
, it seems that it can’t find thevcvarsall.bat
file fromVS90COMNTOOLS
setting, because it requires that the name of the folder that containsvcvarsall.bat
isVC
:
1 productdir = os.path.join(toolsdir, os.pardir, os.pardir, "VC")How can I use the compiler without modify registry or folder name?
best answer:
Update setuptools to 6.0 or greater. In those version setuptools can autodetect Microsoft Visual C++ Compiler for Python 2.7 with the vcvarsall.bat.
Please reference to: