Python error:unable to find Vcvarsall.bat

Source: Internet
Author: User

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=&#039; gcc-mno-cygwin-o-wall& #039; compiler_so=&#039; Gcc-mno-cygwin-mdll-o-wall& #039;, compiler_cxx=&#039; g++-mno-cygwin-o-wall& #039;, linker_exe=&#039;gcc& #039; linker_so=&#039;%s-mno-cygwin%s%s& #039; % (self. Linker_dll, shared_option, entry_point))

Modified to:

1234567 Self . Set_executables(compiler=&#039; gcc-o-wall& #039; compiler_so=&#039; Gcc-mdll-o-wall& #039; compiler_cxx=&#039; g++-mno-cygwin-o-wall& #039;, linker_exe=&#039;gcc& #039; linker_so=&#039;%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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.