Nice programing

Python Pip 설치 오류 : vcvarsall.bat를 찾을 수 없습니다.

nicepro 2021. 1. 5. 21:13
반응형

Python Pip 설치 오류 : vcvarsall.bat를 찾을 수 없습니다. 모든 솔루션을 시도했습니다.


이 질문에 이미 답변이 있습니다.

Python 2.7.8 (anaconda 2.1.0) 32 비트 용 Scrapy를 설치하려고했습니다.

pip install scrapy

그리고이 오류가 발생했습니다

 error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).

이 스택 오버 흐름 질문에서 찾은 솔루션을 따랐습니다. 작동하지 않았습니다.

Python 2.7 용 Microsoft Visual C ++ 컴파일러

vcvarsall.bat 파일을 찾을 수 없습니다.

오류 : vcvarsall.bat를 찾을 수 없습니다.

Windows7 64 비트에서 "pip install numpy"를 실행할 때 "오류 : vcvarsall.bat를 찾을 수 없음"이 표시됨

pip install에서 오류 발생 : vcvarsall.bat를 찾을 수 없음

easy_install을 vcvarsall.bat로 지정하려면 어떻게해야합니까?

pip install MySQL-python이 vcvarsall.bat를 찾을 수 없음을 반환합니다.

이것은 오류이며 그 위와 아래에 몇 줄이 있습니다.

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt
-> build\lib.win32-3.4\lxml\isoschematron\resources\xsl\iso-schematron-xslt1

running build_ext

building 'lxml.etree' extension

C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution opt
ion: 'bugtrack_url'

  warnings.warn(msg)

error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).


----------------------------------------
Command "C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:
\\Users\\San\\AppData\\Local\\Temp\\pip-build-wp6ei6r9\\lxml\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record C:\Users\San\AppData\Local\Temp\pip-kfkzr_67-r
ecord\install-record.txt --single-version-externally-managed --compile" failed w
ith error code 1 in C:\Users\San\AppData\Local\Temp\pip-build-wp6ei6r9\lxml

Microsoft Visual Studio 12.0과 Python 2.7 용 Microsoft Visual C ++ 컴파일러 패키지가 모두 있는데, 둘 다 vcvarsall.bat 파일이 있습니다.


'VS120COMNTOOLS'라는 시스템 변수가 있으며 경로가

C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\

또한 환경 변수에 두 경로를 모두 추가했습니다. 나는 또한 하나를 추가하고 다른 것을 시도했습니다. 내 경로는 다음과 같습니다

C:\Program Files\Java\jdk1.7.0_25\bin;\Python27;\Python2\python.exe;C:\Python27\Scripts\;C:\Users\San\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\;C:\Program Files\Microsoft Visual Studio 12.0\VC\;

또한 Python 2.7 용 Microsoft Visual C ++ Compiler를 자동 감지해야하는 설정 도구 (버전 8로 생각)로 업데이트했습니다. 그러나 여전히 동일한 오류가 발생합니다.


나는 또한 사용해 보았다

easy_install scrapy

그리고이 오류가 발생합니다.

error: Setup script exited with error: Microsoft Visual C++ 10.0 is required (Un

vcvarsall.bat를 찾을 수 있음).


또한 레지스트리에 다음이 있습니다.

HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Setup\VC\ProductDir
HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\12.0\Setup\VC\ProductDir

나는 모든 제안을 시도했고 내 자신의 간단한 해결책을 찾았습니다.

The problem is that codes written in external environment like C need compiler. Look for its own VS environment, i.e. VS 2008.

Currently my machine runs VS 2012 and faces Unable to find vcvarsall.bat. I studied codes that i want to install to find the VS version. It was VS 2008. i have add to system variable VS90COMNTOOLS as variable name and gave the value of VS120COMNTOOLS.

You can find my step by step solution below:

  1. Right click on My Computer.
  2. Click Properties
  3. Advanced system settings
  4. Environment variables
  5. Add New system variable
  6. Enter VS90COMNTOOLS to the variable name
  7. Enter the value of current version to the new variable.
  8. Close all windows

Now open a new session and pip install your-package


After doing a lot of things, I upgraded pip, setuptools and virtualenv.

  1. python -m pip install -U pip
  2. pip install -U setuptools
  3. pip install -U virtualenv

I did steps 1, 2 in my virtual environment as well as globally. Next, I installed the package through pip and it worked.


Try installing this, it's a known workaround for enabling the C++ compiler for Python 2.7.

In my experience, when pip does not find vcvarsall.bat compiler, all I do is opening a Visual Studio console as it set the path variables to call vcvarsall.bat directly and then I run pip on this command line.


I was getting the same error in python 3.4.3 too and I tried using the solutions mentioned here and elsewhere with no success.

Microsoft makes a compiler available for Python 2.7 but it didn't do me much good since I am on 3.4.3.

Python since 3.3 has transitioned over to 2010 and you can download and install Visual C++ 2010 Express for free here: https://www.visualstudio.com/downloads/download-visual-studio-vs#d-2010-express

Here is the official blog post talking about the transition to 2010 for 3.3: http://blog.python.org/2012/05/recent-windows-changes-in-python-33.html

Because previous versions gave a different error for vcvarsall.bat I would double check the version you are using with "pip -V"

C:\Users\B>pip -V
pip 6.0.8 from C:\Python34\lib\site-packages (python 3.4)

As a side note, I too tried using the latest version of VC++ (2013) first but it required installing 2010 express.

From that point forward it should work for anyone using the 32 bit version, if you are on the 64 bit version you will then get the ValueError: ['path'] message because VC++ 2010 doesn't have a 64 bit compuler. For that you have to get the Microsoft SDK 7.1. I can't hyperlink the instruction for 64 bit because I am limited to 2 links per post but its at

Python PIP has issues with path for MS Visual Studio 2010 Express for 64-bit install on Windows 7


Here too I can reproduce this problem with scrapy and psycopg2 (both require C++ compiling), even though I have Microsoft Visual C++ Compiler for Python 2.7 installed.

It has to be noted that I use virtualenv. From your post I'm not sure whether you do the same.

Anyway I tried to skip the activation of the virtual environment. Then both scrapy and psycopg2 installed fine.

My hypothesis: there is a conflict between this 2014 C++ compiler for Python and virtualenv. I do not know why nor how to solve it (and I'd be glad if someone can suggest a workaround).

ReferenceURL : https://stackoverflow.com/questions/27670365/python-pip-install-error-unable-to-find-vcvarsall-bat-tried-all-solutions

반응형