12

I tried all the methods that I can find online and I even dove into the python code it didn't help.

I am using windows 7 64 bit version. I have installed Microsoft VS 2008 and 2012 both. The Python I installed is 3.5

When I run pip install numpy, I am getting error:

Unable to find vcvarsall.bat

The version return by the code in msvc9compiler.py shows my VS version is 14.0 and I dive into all kinds of windows registry to add a couple of entries(VC and ProdctDir to point to the VS 2008 VC folder). It didn't help. I can run vcvarsall.bat from the command line and it runs fine with following result. Setting environment for using Microsoft Visual Studio 2008 x86 tools.

I though it works fine.

Is there anything else I can try? I have spent two days on this.

Rick Smith
  • 9,031
  • 15
  • 81
  • 85
frank j
  • 131
  • 1
  • 1
  • 4
  • 2
    Python 3.5 requires [Visual Studio 2015](https://www.visualstudio.com/en-us/products/vs-2015-product-editions.aspx). – cgohlke Sep 17 '15 at 19:17

2 Answers2

5

according to this : https://www.python.org/downloads/release/python-350a1/ python 3.5 is compiled with vs2015.

if you done want to install vs2015 you can set the enviroment variable VS__COMNTOOLS where __ is the version number of visual studio. for example in python 2.7 i had to do this in cmd before using pip

SET VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\

im not sure but i think the version number of vs2015 is 13 so do

SET VS130COMNTOOLS=C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\ 

or you can do

SET VS130COMNTOOLS=%VS10COMNTOOLS%
DorElias
  • 2,243
  • 15
  • 18
  • I have two places for vcvarsall.bat C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC and C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC These are for VS 2008 and VS 2012. Are you positive that I need to install VS 2015 for Python 3.5? – frank j Sep 17 '15 at 19:45
  • Put the one of the newer visual Studio version – DorElias Sep 17 '15 at 20:42
  • I downloaded and installed VS 2015 from Microsoft. There is a new environment variable created VS140COMNTOOLS the value is C:\Program Files\Microsoft Visual Studio 14.0\Common7\Tools\ One thing I don't get it is I didn't see the compiler vcvarsall.bat in the folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC It's still not working. I am getting same error. – frank j Sep 18 '15 at 05:08
  • I missed some component when I run the installation. Now I added Visual C++ tool box and the compiler showed up. When I run pip install numpy, I am getting different error now. Tried to install other packages, each one has different error. Such as ValueError SyntaxError. Maybe pip downloaded a version for Python 2.7? – frank j Sep 18 '15 at 05:38
  • Can you add the errors so we can see what's happening? – DorElias Sep 18 '15 at 07:44
  • I gave up on python 3.5. Installed 2.7 and everything works fine now. thank you for the help though. – frank j Sep 18 '15 at 21:14
  • Lots of us stuck at the same place as you frank... were you able to resolve this? No idea why MS / Python would not create an easy approach to this. – Bonson Feb 21 '16 at 08:03
5

Bonson, Frank, etc.

Re-install or upgrade Visual Studio 2015 Community and make sure you select Visual C++ then proceed. It worked for me on Windows 7 64bit with Python 3.5.1 which I installed as part of WinPython 3.5.1.2 64bit.

Visual C++

See also: vcvarsall.bat needed for python to compile missing from visual studio 2015 ( v 14)

Community
  • 1
  • 1
Josh Morel
  • 1,201
  • 12
  • 17