Unable to find vcvarsall.bat using Python 3.3 in Windows 8
Asked Answered
N

5

20

I am having an issue when I try to run:

pip install numpy

I get:

unable to find vcvarsall.bat.

I followed this procedure: How to use MinGW's gcc compiler when installing Python package using Pip?.

  • I installed MinGW with C++ compiler option checked
  • I added MinGW to my path

Here is my path

 C:\Python33\;%SYSTEMROOT%\SYSTEM32;%SYSTEMROOT%;%SYSTEMROOT%\SYSTEM32\WBEM;%SYSTEMROOT%\SYSTEM32\WINDOWSPOWERSHELL\V1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Python33\;C:\Python33\Scripts;C:\MinGW\bin;
  • I created distutils.cfg with the following lines

    [build]
    compiler=mingw32
    

In here:

C:\Python33\Lib\distutils\distutils.cfg

Still getting the same error, not sure what I am doing wrong.

I am using Windows 8 system (32 bit), Python 3.3. I installed Visual Studio 12.0 which I would want to ultimately use as my IDE for Python.

Thanks for your help!

EDIT:

easy_install numpy

Works without a glitch.

Newmint answered 15/7, 2013 at 15:34 Comment(0)
W
8

I am using the same setup and installing visual studio 2010 express was the easiest solution for me. http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express

Python 3.3 was built using VS 2010. http://blog.python.org/2012/05/recent-windows-changes-in-python-33.html

Whippersnapper answered 2/8, 2013 at 21:45 Comment(2)
For anyone looking for a direct link to it's ISO use this -> download.microsoft.com/download/1/E/5/…Collop
@Collop THANK YOU SO MUCH. Looking all over the web for an actual download of deprecated software and finding VS2015 everywhere instead is infuriating.Diphthong
C
11

As other people have already mentioned, it appears that you do not have Microsoft Visual Studio 2010 installed on your computer. Older versions of Python used Visual Studio 2008, but now the 2010 version is used. The 2010 version in particular is used to compile some of the code (not 2008, 2013, or any other version).

What is happening is that the installer is looking in your environmental variables for the Visual Studio 2010 tools. Note that Visual Studio 2008 or 2013 will NOT work, since the compiler is specifically looking for the 2010 version of the tools.

To see if you indeed have the 2010 version properly set up, right click on My Computer. Then go to "Properties". In the window that is opened, there should be an option for "Advanced system settings" on the left hand side. In the new window that opens, go to the "Advanced" tab, then click on the "Environmental Variables" Button. In the "System Variables", there should be a Variable called "VS100COMNTOOLS" that points to the Visual Studio 2010 Tools Directory. On my system, this is "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\".

What one of the users suggested above, was a work around if you have a different version of Visual Studio. For instance, I have a 2013 version of Visual Studio, and hence I have a Variable called "VS120COMNTOOLS" which points to the 2013 toolset. Since the versions of Visual Studio share a lot of the same tools, you could probably compile Python with a newer or older version of Visual Studio, by simply adding a new variable called "VS100COMNTOOLS" which has the value of either %VS120COMNTOOLS%, or the directory that VS120COMNTOOLS points to. In this case, when Python trys to compile, it will think it is using the 2010 tools, but it will actually be using the 2013 tools on your system (or whichever version of Visual Studio you have). Of course doing this could cause problems, but my guess is that everything will work just fine. Just be aware that if you ever experience problems, it could be due to using the wrong tools.

The best method would be to install Visual Studio 2010 express (which is free I think).

Chalco answered 11/4, 2014 at 8:34 Comment(4)
Worked perfectly for installing paramiko and deps.Jacoby
so this should also work? microsoft.com/en-gb/download/details.aspx?id=5555Needlewoman
doesn't seem to work ... still getting the same error, nor can I find the install path that the downloaded file hits ... any ideas?Needlewoman
Then try downloading the whole IDE. I do not know where the file you mention will download.Chalco
W
8

I am using the same setup and installing visual studio 2010 express was the easiest solution for me. http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express

Python 3.3 was built using VS 2010. http://blog.python.org/2012/05/recent-windows-changes-in-python-33.html

Whippersnapper answered 2/8, 2013 at 21:45 Comment(2)
For anyone looking for a direct link to it's ISO use this -> download.microsoft.com/download/1/E/5/…Collop
@Collop THANK YOU SO MUCH. Looking all over the web for an actual download of deprecated software and finding VS2015 everywhere instead is infuriating.Diphthong
E
5

You can stick with Visual Studio, but you have to "redirect" it to the one you have installed. In my case I have VS 2012, Python 3.3

SET VS100COMNTOOLS=%VS110COMNTOOLS%

This will make pip use the VS2012's vcvarsall.bat file. Older versions of python might require to alter VS90COMNTOOLS variable.

Enliven answered 26/10, 2013 at 20:37 Comment(3)
I tried doing this, but get a broken toolchain error. Came here looking to see if people had any other ideas.Olympium
@Asad Try following my other question for the broken toolchain error, you need to change the following in msvc9compiler.py KEY_BASE = r"Software\Microsoft\\". This works for "some" problems which is why my question is not answered yet.Newmint
For Visual studio 2013 use SET VS100COMNTOOLS=%VS110COMNTOOLS% if you get toolchain error use the visual studio x86 command promptJointworm
P
4

I had the same problem. I have VS2012 and python 2.7

Ran the following in cmd tool

SET VS90COMNTOOLS=%VS110COMNTOOLS%

then used pip install

It worked.

Pass answered 20/12, 2013 at 3:48 Comment(0)
S
2

I had the same problem on Windows 8, downloading and installing compiled numpy library from http://www.lfd.uci.edu/~gohlke/pythonlibs/ helped.

Slivovitz answered 17/9, 2013 at 15:24 Comment(1)
Thanks. One thing I loved about R was that package installation and versioning was so simple on Windows. :/ Python...Heliogravure

© 2022 - 2024 — McMap. All rights reserved.