Python Pip install Error: Unable to find vcvarsall.bat. Tried all solutions
This question already has an answer here:
I have tried all suggestions and found my own simple solution.
The problem is that codes written in external environment like C
need compiler. Look for its own VS environment, ie 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:
Now open a new session and pip install your-package
After doing a lot of things, I upgraded pip
, setuptools
and virtualenv
.
python -m pip install -U pip
pip install -U setuptools
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.
链接地址: http://www.djcxy.com/p/26314.html