repositories - python packages like numpy
Error: Microsoft Visual C++ 10.0 is required(Unable to find vcvarsall.bat) (6)
This question already has an answer here:
Im trying to install numpy with PyCharm but i keep getting this error:
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
Can someone please explain to me exactly what i have to do to fix this error(and as simple and detailed as possible)? im using python 3.4.2 (i know this has been answered before but i did not understand it).
I have encountered this problem twice. First time I used VS 2013 and the second time I used VS 2015 with different solution. The first solution on VS 2013 and python 2.7 is:
- Click win+R
- Close all windows
- Enter pip install again
Now, one year later, I have found an easier method to fix it. This time I use VS 2015 and python 3.4.
- Right click on My Computer.
- Click Properties
- Advanced system settings
- Environment variables
- Add New system variable
VS100COMNTOOLSto the variable name
Enter the value of
VS140COMNTOOLSto the new variable.
- Close all windows
Now I'm sure you will ask some question what is the
and what should I do if I use VS2008 or other compiler.
There is a file python\Lib\distutils\msvc9compiler.py, beginning on line 216 we see
def find_vcvarsall(version): """Find the vcvarsall.bat file At first it tries to find the productdir of VS 2010 in the registry. If that fails it falls back to the VS100COMNTOOLS env var. """
It means that you must give the productdir of VS 2010 for it, so if you are using python 2.x and
Visual Studio 2010 (VS10):SET VS90COMNTOOLS=%VS100COMNTOOLS%
Visual Studio 2012 (VS11):SET VS90COMNTOOLS=%VS110COMNTOOLS%
Visual Studio 2013 (VS12):SET VS90COMNTOOLS=%VS120COMNTOOLS%
Visual Studio 2015 (VS15):SET VS90COMNTOOLS=%VS140COMNTOOLS%
or if you are using python 3.x and
Visual Studio 2010 (VS10):SET VS100COMNTOOLS=%VS100COMNTOOLS%
Visual Studio 2012 (VS11):SET VS100COMNTOOLS=%VS110COMNTOOLS%
Visual Studio 2013 (VS12):SET VS100COMNTOOLS=%VS120COMNTOOLS%
Visual Studio 2015 (VS15):SET VS100COMNTOOLS=%VS140COMNTOOLS%
And it's the same as adding a new system variable. See the second ways.
Update:Sometimes,it still doesn't work.Check your path,ensure that contains
Python 3.3 and later now uses the 2010 compiler. To best way to solve the issue is to just install Visual C++ Express 2010 for free.
Now comes the harder part for 64 bit users and to be honest I just moved to 32 bit but 2010 express doesn't come with a 64 bit compiler (you get a new error, ValueError: ['path'] ) so you have to install Microsoft SDK 7.1 and follow the directions here to get the 64 bit compiler working with python: Python PIP has issues with path for MS Visual Studio 2010 Express for 64-bit install on Windows 7
It may just be easier for you to use the 32 bit version for now. In addition to getting the compiler working, you can bypass the need to compile many modules by getting the binary wheel file from this locaiton http://www.lfd.uci.edu/~gohlke/pythonlibs/
Just download the .whl file you need, shift + right click the download folder and select "open command window here" and run
pip install module-name.whl
I used that method on 64 bit 3.4.3 before I broke down and decided to just get a working compiler for pip compiles modules from source by default, which is why the binary wheel files work and having pip build from source doesn't.
People getting this (vcvarsall.bat) error on Python 2.7 can instead install "Microsoft Visual C++ Compiler for Python 2.7"
Tried to install lxml, grab and other extensions, which requires VS 10.0+ and get the same issue. I find own way to solve this problem(Windows 10 x64, Python 3.4+):
Install Visual C++ 2010 Express ( download ). (Do not install Microsoft Visual Studio 2010 Service Pack 1 )
Remove all the Microsoft Visual C++ 2010 Redistributable packages from Control Panel\Programs and Features. If you don't do those then the install is going to fail with an obscure "Fatal error during installation" error.
Install offline version of Windows SDK for Visual Studio 2010 (v7.1) ( download ). This is required for 64bit extensions. Windows has builtin mounting for ISOs. Just mount the ISO and run Setup\SDKSetup.exe instead of setup.exe.
Create a vcvars64.bat file in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64 that contains:
CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
Find extension on this site, then put them into the python folder, and install .whl extension with pip:
python -m pip install extensionname.whl
you can download .whl in LFD . Then use "pip install ***.whl" in CMD
you have to check your pip package to be updated to the latest version in your pycharm and then install numpy package. in settings -> project:progLangComp -> Project Interpreter there is a table of packages and their current version (just labelled as Version) and their latest version (labelled as Latest). Pip current version number should be the same as latest version. If you see a blue arrow in front of pip, you have to update it to the latest then trying to install numpy or any other packages that you couldn't install, for me it was pandas which I wanted to install.