When installing some Python modules, most of the modules written by CPython will have the following error error:unable to find Vcvarsall.bat. Previous article: This issue was also mentioned when installing Scrapy on Windows. The solution was to install VS 2008 to fix it, but vs 2008 was too big to pretend, so this time I thought of another solution, the same last time, which was very incomplete.
Solution One: Installation Vs2008 (measured)
Complete without brain flow, install the problem directly resolved.
Solution Two: Install Vs2010 (not tested)
Last time on the computer to install a Vs2010 and do not like vs2008 directly solve the problem, from the Internet to find the following solutions, I do not know whether it is feasible.
Open "<python installation directory >\lib\distutils\msvc9compiler.py"
Find Toolskey = "Vs%0.f0comntools"% version, directly modified to Toolskey = "Vs100comntools"
Solution Three: Installation MinGW (measured)
1, download installs MinGW, is: http://sourceforge.net/projects/mingw/files/latest/download?source=files
2, find the Bin folder in the MinGW installation directory, find Mingw32-make.exe, copy the name of the Make.exe
3, add the path of the MinGW to the environment variable path, for example, I put the MinGW installed into the D:\MinGW\, the D:\MinGW\bin added to the path;
4, in the <python installation directory >\lib\distutils add File Distutils.cfg, in the file input
[Build]
Compiler=mingw32
Save
.......
.......
5, the implementation of the original module installation, found or error, the error content is: Error:command ' gcc ' failed:no such the file or directory solution is to add D:\MinGW\lib to the path.
6, if the installation process appears error:could not find ' openssl.exe ' then directly to the http://pypi.python.org/pypi/pyOpenSSL/0.13 download installation.
6. When the module is installed again, the following error is found:
D:\MinGW\bin\gcc.exe-mno-cygwin-mdll-O-wall "-id:\program files\python27\inc
Lude ""-id:\program files\python27\include ""-id:\program files\python27\pc "-C
.. /libdasm.c-o build\temp.win32-2.7\release\. \libdasm.o
cc1.exe:error:unrecognized command line option '-mno-cygwin '
Error:command ' gcc ' failed with exit status 1
The reason is that GCC 4.6.x will no longer accept -mno-cygwin in order to resolve this problem need to modify the <python installation directory >\distutils\cygwinccompiler.py file. Found it:
1234567 |
Self . Set_executables(compiler=' gcc-mno-cygwin-o-wall& #039; compiler_so=' Gcc-mno-cygwin-mdll-o-wall& #039;, compiler_cxx=' g++-mno-cygwin-o-wall& #039;, linker_exe='gcc& #039; linker_so='%s-mno-cygwin%s%s& #039; % (self. Linker_dll, shared_option, entry_point)) |
Modified to:
1234567 |
Self . Set_executables(compiler=' gcc-o-wall& #039; compiler_so=' Gcc-mdll-o-wall& #039; compiler_cxx=' g++-mno-cygwin-o-wall& #039;, linker_exe='gcc& #039; linker_so='%s-mno-cygwin%s%s& #039; % (self. Linker_dll, shared_option entry_point)) |
At this point, it's done!
Python error:unable to find Vcvarsall.bat