Getting “error: Unable to find vcvarsall.bat” when running “pip install numpy” on windows7 64bit

前端 未结 6 1153
不思量自难忘°
不思量自难忘° 2020-12-11 03:27

I\'m running pip install numpy on windows7 64bit and i\'m getting error: Unable to find vcvarsall.bat

相关标签:
6条回答
  • 2020-12-11 04:01

    Had the same problem on my 64-Bit Windows. The issue was resolved by installing the Microsoft Visual C++ Compiler for Python 2.7, which is described by Microsoft as:

    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

    ...

    Works like a charm.

    0 讨论(0)
  • 2020-12-11 04:01

    For 64-bit systems, this problem can be resolved by the following 5 steps. (taken from http://springflex.blogspot.in/2014/02/how-to-fix-valueerror-when-trying-to.html)

    1. download vcsetup.exe (Visual Studio 2008 Express installer) and install from : go.microsoft.com/?linkid=7729279
    2. Install the Microsoft Windows SDK from: http://www.microsoft.com/en-us/download/details.aspx?id=24826

      select web setup link under installation instructions to get an installer.

    3. Run the installer file unselect samples and documentation if they are not required

    4. Create a copy of the batch file "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat" and rename it to "vcvarsamd64.bat" in the same folder.

    5. Copy the file "vcvarsamd64.bat" and paste it in the folder "C:\Program Files (x86)\Microsoft Visual Studio 9.0/VC/bin/amd64"

    0 讨论(0)
  • 2020-12-11 04:02

    Maybe you want to use the prebuilt binaries here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy? Using pip likely wont yield any good results. The reason is that numpy doesn't compile with Visual Studio at all and needs to be built with gcc.

    If you still really want to compile numpy, you need to setup a Linux machine with Vagrant and follow the official build instructions here: https://github.com/juliantaylor/numpy-vendor

    0 讨论(0)
  • 2020-12-11 04:07

    Try to run below commands. I faced similar issue, but for some other module. It got resolved after running below commands.

    python -m pip install -U pip

    pip install -U setuptools

    pip install -U virtualenv

    0 讨论(0)
  • 2020-12-11 04:13

    You need to download and install vcsetup.exe(Visual C++ 2008 express edition) file

    And then add newly created vcvarsall.bat file path to "PATH" environment variable.

    Make sure there are no special symbols in your PATH environment variable after adding

    0 讨论(0)
  • 2020-12-11 04:13

    A procedure which works on my Windows 7, 64 bit, and Python 2.7 is to download the binaries of numpy directly from Sourceforge. E.g. numpy-1.9.2-win32-superpack-python2.7.exe.

    Then extract the EXE files for example with 7z. There will be three EXE files, e.g. numpy-1.9.2-nosse.exe, numpy-1.9.2-sse2.exe, numpy-1.9.2-sse3.exe.

    Choose the appropriate now. On more or less modern processors SSE3 will be fine.

    SciPy works with the same procedure: SF-link

    If binaries are OK for you, the only disadvantage is that you cannot update the packages via pip.

    0 讨论(0)
提交回复
热议问题