Tag Archives: Python error: Unable to find vcvarsall.bat

Python error: Unable to find vcvarsall.bat [How to Solve]

Python error: Unable to find vcvarsall.bat

Solution 1: install VS2008 (measured)

There is no brain flow completely. After installation, the problem can be solved directly

Solution 2: install VS2010 (not tested)

The last time I installed a VS2010 on my computer, it couldn’t solve the problem as directly as VS2008. I found the following solution from the Internet, I don’t know if it is feasible

Open “& lt; Python installation directory & gt\ Lib\distutils\msvc9compiler.py”

Find toolskey = “vs% 0. F0comntools”% version, and directly modify it to toolskey = “vs100comntools”

Solution 3: install MinGW (measured)

1. Download and install MinGW at: http://sourceforge.net/projects/mingw/files/latest/download?source=files

2. In the installation directory of MinGW, find the bin folder, find mingw32-make.exe, and make a copy of it and change it to make.exe

3. Add the path of MinGW to the environment variable path. For example, if I install MinGW to D:: MinGW, I will add D:: MinGW \ \ bin to the path

4. In & lt; Python installation directory & gt\ Add the file distutils.cfg to distutils, and enter it in the file

[build]

compiler=mingw32

Preservation

5. After performing the original module installation, it is found that an error is still reported. The content of the error is: error: Command ‘GCC’ failed: no such file or directory. The solution is to add D:// MinGW/lib to the path

6. If error: could not find ‘OpenSSL. Exe’ appears during the installation, go to http://pypi.python.org/pypi/pyOpenSSL/0.13 Download and install

When installing the module again, the following error was 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 – MnO cygwin is no longer accepted by GCC 4.6. X. in order to solve this problem, we need to modify & lt; Python installation directory & gt\ Distutils file. Find:

self.set_ executables(compiler=’gcc -mno-cygwin -O -Wall’,

compiler_ so=’gcc -mno-cygwin -mdll -O -Wall’,

compiler_ cxx=’g++ -mno-cygwin -O -Wall’,

linker_ exe=’gcc’,

linker_ so=’%s -mno-cygwin %s %s’

% (self.linker_ dll, shared_ option,

entry_ point))

To be amended as follows:

self.set_ executables(compiler=’gcc -O -Wall’,

compiler_ so=’gcc -mdll -O -Wall’,

compiler_ cxx=’g++ -mno-cygwin -O -Wall’,

linker_ exe=’gcc’,

linker_ so=’%s -mno-cygwin %s %s’

% (self.linker_ dll, shared_ option,

entry_ point))

I talked about three solutions. The installation of visual studio is too huge. I didn’t try it, so I tried the third method. The error of openssl.exe has not been encountered. It should have existed. However, the directory of distutils.cfg file is a little different under python2.7, which is under python27/lib/distutils. Until the last modification, the final error is:

error: expected ‘=’, ‘,’, ‘;’, ‘ asm’ or ‘__ attribute__’ before ‘PyInt_ AsUnsignedLongLongMask’

There is no solution

There is a warning in the middle. Use DOS style path in cygwin and set path cygwin = nodosfilewarning to avoid it

cygwin warning:

MS-DOS style path detected: C:\cygwin\home\ADMINI~1\hadoop\/build/native

Preferred POSIX equivalent is: /home/ADMINI~1/hadoop/build/native

CYGWIN environment variable option “nodosfilewarning” turns off this warning.

Consult the user’s guide for more details about POSIX paths:

http://cygwin.com/cygwin-ug-net/using.html#using -pathnames

12/02/13 10:34:53 INFO namenode.NameNode: STARTUP_ MSG:

python setup.py install build –compiler=mingw32

This command can’t be tried