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

39,446

Solution 1

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

Solution 2

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).

Solution 3

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.

Solution 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.

Solution 5

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

Share:
39,446

Related videos on Youtube

Matt
Author by

Matt

Updated on July 09, 2022

Comments

  • Matt
    Matt almost 2 years

    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.

  • Asad Saeeduddin
    Asad Saeeduddin about 10 years
    I tried doing this, but get a broken toolchain error. Came here looking to see if people had any other ideas.
  • obesechicken13
    obesechicken13 almost 10 years
    Thanks. One thing I loved about R was that package installation and versioning was so simple on Windows. :/ Python...
  • Matt
    Matt almost 10 years
    @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.
  • Zeta Two
    Zeta Two over 9 years
    Worked perfectly for installing paramiko and deps.
  • Atiq Rahman
    Atiq Rahman about 9 years
    For Visual studio 2013 use SET VS100COMNTOOLS=%VS110COMNTOOLS% if you get toolchain error use the visual studio x86 command prompt
  • fedmich
    fedmich almost 9 years
    For anyone looking for a direct link to it's ISO use this -> download.microsoft.com/download/1/E/5/…
  • Ammar Akhtar
    Ammar Akhtar almost 9 years
  • Ammar Akhtar
    Ammar Akhtar over 8 years
    doesn't seem to work ... still getting the same error, nor can I find the install path that the downloaded file hits ... any ideas?
  • bremen_matt
    bremen_matt over 8 years
    Then try downloading the whole IDE. I do not know where the file you mention will download.
  • Federico Motta
    Federico Motta about 8 years
    @fedmich THANK YOU SO MUCH. Looking all over the web for an actual download of deprecated software and finding VS2015 everywhere instead is infuriating.