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

前端 未结 6 1545
猫巷女王i
猫巷女王i 2020-11-30 00:16

I am trying to install numpy in python 3.5 under windows 10 with visual studio 2015 ultimate installed.

Short version: file vcvarsall.bat is missing fro

相关标签:
6条回答
  • 2020-11-30 00:50

    Make sure C++ Common Tools are installed in Visual Studio.

    Programs and Features -> VS 2015 -> Change

    0 讨论(0)
  • 2020-11-30 00:51

    I downloaded the Microsoft Visual C++ build Tools Link Here and everything worked great.

    0 讨论(0)
  • 2020-11-30 00:54

    I met this problem when I was trying to build ujson package with python 2.7 (compiled with VS 2015).

    • vcvarsall.bat: try to copy vsvars32.bat (from the same directory - "c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools") to vcvarsall.bat. It's all you need for build
    • another problem is detecting VS version in function get_build_version() (distutils/msvc9compiler.py). You need to change this function to return right version of VS.

    There is this line:

    majorVersion = int(s[:-2]) - 6
    

    it sets majorVersion to 13, but the correct version for VS 2015 is 14. So you need add two line, for example:

    if majorVersion == 13:
        majorVersion = 14 
    
    0 讨论(0)
  • 2020-11-30 01:00

    I just had the same problem (Windows 7, Python 3.4, pip 7.1)

    pip install mysqlclient
    (...)
    error: Unable to find vcvarsall.bat
    

    I followed these instructions: https://www.linkedin.com/pulse/resolving-python-error-unable-find-vcvarsallbat-bhanu-pratap-singh/

    Then upgraded pip to 9.0.1 with

    python -m pip install --upgrade pip
    

    tried again:

    pip install mysqlclient
    

    and voilà:

    Successfully installed mysqlclient-1.3.12
    
    0 讨论(0)
  • I've come across this problem before when trying to install numpy. Although I was unable to fix the 'vcvarsall.bat' problem, I found that i could download pre compiled libraries from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/ Download the libraries you want, navigate to wherever the downloaded .whl files are and open a command prompt window. run 'pip install [whl file name]' This will install the library for you with no compile issue.

    0 讨论(0)
  • 2020-11-30 01:01

    While installing any Python 2.7 module if you are facing the error:

    error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat)
    

    Windows OS Solution

    The easiest solution would be to:

    • Browse to the URL http://aka.ms/vcpython27
    • Download Microsoft Visual C++ Compiler for Python 2.7
    • Snapshot:

    • Version : 9.0.0.30729
    • File Name : VCForPython27.msi
    • Date Published : 9/29/2014
    • File Size : 83.8 MB
    • Details:

      • This package contains the compiler and set of system headers necessary for producing binary wheels for Python packages. A binary wheel of a Python package can then be installed on any Windows system without requiring access to a C compiler.

      • The typical error message you will receive if you need this compiler package is Unable to find vcvarsall.bat

      • This message appears because the Python package being installed contains the source code for a native extension module (.pyd), but does not have a pre-built copy of the module. The Python packages highlighted at pythonwheels.com have already been updated by their developers to include pre-built binaries, but many are still only available as source code.

      • This compiler package is entirely unsupported and represents a snapshot of the last version that is fully compatible with Python 2.7. For the latest security and bug fixes, please use the latest version of Microsoft Visual Studio for any development work that does not directly interface with Python 2.7.

    • Systems Requirements:
      • Supported Operating System : Windows 7, Windows 8, Windows 8.1
      • Microsoft Visual C++ 2008 SP1 Redistributable Package (x86, x64) Windows 8 and later require the Microsoft .NET Framework 3.5. See here for installation instructions.
      • Disk Space Requirements : Installation requires 380 megabytes (MB) of hard disk space.
      • Python Packages setuptools 6.0 or later is required for Python to automatically detect this compiler package. wheel is recommended for producing pre-built binary packages.
    • Install Instructions:
      • Installing and Uninstalling The compiler package will default to installing just for the current user and does not require administrative privileges. To install for all users of a machine, execute msiexec /i ALLUSERS=1 from an elevated Command Prompt.
      • Using with Python distribution tools Python package developers should download and use this compiler to produce binary wheels for their Python packages to upload to PyPI. Installing the wheel package, updating to setuptools 6.0 or later, and adding setup.py bdist_wheel upload to your build process will produce the correct files (remember to do this for both 32-bit and 64-bit versions).
      • If a Python package you are installing does not have a wheel, you can install this compiler package on your own machine. Once the compiler is installed and you have updated to setuptools 6.0 or later, you can use pip install to build and install the Python package. If you are managing multiple machines and need to install the Python package on all of them, you should install the wheel package and use pip wheel to produce a wheel that can be installed on machines without requiring this package.
    • Install the package on your localhost.
    • Install the required Python 2.7 module successfully without any errors.
    0 讨论(0)
提交回复
热议问题