9

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

I've already installed some packages with pip, e.g. pyzmq,pysolr,enum,etc., so I really don't know what went wrong.

The only thing that might be different is that I've install .NET framework version 4.5 -> I suspect that could be the reason because in some posts I saw it might have to do with Visual Studio (That I didn't install)

The full error/traceback:

Downloading/unpacking numpy
      Running setup.py (path:c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\setup.py) egg_info for package numpy
        Running from numpy source directory.

    warning: no files found matching 'tools\py3tool.py'
    warning: no files found matching '*' under directory 'doc\f2py'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.pyo' found anywhere in distribution
    warning: no previously-included files matching '*.pyd' found anywhere in distribution
Installing collected packages: numpy
  Running setup.py install for numpy
    non-existing path in 'numpy\\distutils': 'site.cfg'
    F2PY Version 2
    blas_opt_info:
    blas_mkl_info:
      libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']
      NOT AVAILABLE

    openblas_info:
      libraries  not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']
      NOT AVAILABLE

    atlas_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']
      NOT AVAILABLE

    atlas_blas_info:
      libraries f77blas,cblas,atlas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']
      NOT AVAILABLE

    blas_info:
      libraries blas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']
      NOT AVAILABLE

    blas_src_info:
      NOT AVAILABLE

      NOT AVAILABLE

    non-existing path in 'numpy\\lib': 'benchmarks'
    lapack_opt_info:
    lapack_mkl_info:
    mkl_info:
      libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']
      NOT AVAILABLE

      NOT AVAILABLE

    atlas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in C:\Python27\lib
      libraries lapack_atlas not found in C:\Python27\lib
      libraries ptf77blas,ptcblas,atlas not found in C:\
      libraries lapack_atlas not found in C:\
      libraries ptf77blas,ptcblas,atlas not found in C:\Python27\libs
      libraries lapack_atlas not found in C:\Python27\libs
    numpy.distutils.system_info.atlas_threads_info
      NOT AVAILABLE

    atlas_info:
      libraries f77blas,cblas,atlas not found in C:\Python27\lib
      libraries lapack_atlas not found in C:\Python27\lib
      libraries f77blas,cblas,atlas not found in C:\
      libraries lapack_atlas not found in C:\
      libraries f77blas,cblas,atlas not found in C:\Python27\libs
      libraries lapack_atlas not found in C:\Python27\libs
    numpy.distutils.system_info.atlas_info
      NOT AVAILABLE

    lapack_info:
      libraries lapack not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']
      NOT AVAILABLE

    lapack_src_info:
      NOT AVAILABLE

      NOT AVAILABLE

    unifing config_cc, config, build_clib, build_ext, build commands --compiler options
    unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
    build_src
    building py_modules sources
    building library "npymath" sources
    No module named msvccompiler in numpy.distutils; trying from distutils
    Running from numpy source directory.
    c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\numpy\distutils\system_info.py:1521: UserWarning:
        Atlas (http://math-atlas.sourceforge.net/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [atlas]) or by setting
        the ATLAS environment variable.
      warnings.warn(AtlasNotFoundError.__doc__)
    c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\numpy\distutils\system_info.py:1530: UserWarning:
        Blas (http://www.netlib.org/blas/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [blas]) or by setting
        the BLAS environment variable.
      warnings.warn(BlasNotFoundError.__doc__)
    c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\numpy\distutils\system_info.py:1533: UserWarning:
        Blas (http://www.netlib.org/blas/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [blas_src]) or by setting
        the BLAS_SRC environment variable.
      warnings.warn(BlasSrcNotFoundError.__doc__)
    c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\numpy\distutils\system_info.py:1427: UserWarning:
        Atlas (http://math-atlas.sourceforge.net/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [atlas]) or by setting
        the ATLAS environment variable.
      warnings.warn(AtlasNotFoundError.__doc__)
    c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\numpy\distutils\system_info.py:1438: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      warnings.warn(LapackNotFoundError.__doc__)
    c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\numpy\distutils\system_info.py:1441: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      warnings.warn(LapackSrcNotFoundError.__doc__)
    C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    error: Unable to find vcvarsall.bat
    Complete output from command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\zebra\\appdata\\local\\temp\\pip_build_zebra\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\zebra\appdata\local\temp\pip-py_oa_-record\install-record.txt --single-version-externally-managed --compile:
    non-existing path in 'numpy\\distutils': 'site.cfg'

F2PY Version 2

blas_opt_info:

blas_mkl_info:

  libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']

  NOT AVAILABLE



openblas_info:

  libraries  not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']

  NOT AVAILABLE



atlas_blas_threads_info:

Setting PTATLAS=ATLAS

  libraries ptf77blas,ptcblas,atlas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']

  NOT AVAILABLE



atlas_blas_info:

  libraries f77blas,cblas,atlas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']

  NOT AVAILABLE



blas_info:

  libraries blas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']

  NOT AVAILABLE



blas_src_info:

  NOT AVAILABLE



  NOT AVAILABLE



non-existing path in 'numpy\\lib': 'benchmarks'

lapack_opt_info:

lapack_mkl_info:

mkl_info:

  libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']

  NOT AVAILABLE



  NOT AVAILABLE



atlas_threads_info:

Setting PTATLAS=ATLAS

  libraries ptf77blas,ptcblas,atlas not found in C:\Python27\lib

  libraries lapack_atlas not found in C:\Python27\lib

  libraries ptf77blas,ptcblas,atlas not found in C:\

  libraries lapack_atlas not found in C:\

  libraries ptf77blas,ptcblas,atlas not found in C:\Python27\libs

  libraries lapack_atlas not found in C:\Python27\libs

numpy.distutils.system_info.atlas_threads_info

  NOT AVAILABLE



atlas_info:

  libraries f77blas,cblas,atlas not found in C:\Python27\lib

  libraries lapack_atlas not found in C:\Python27\lib

  libraries f77blas,cblas,atlas not found in C:\

  libraries lapack_atlas not found in C:\

  libraries f77blas,cblas,atlas not found in C:\Python27\libs

  libraries lapack_atlas not found in C:\Python27\libs

numpy.distutils.system_info.atlas_info

  NOT AVAILABLE



lapack_info:

  libraries lapack not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs']

  NOT AVAILABLE



lapack_src_info:

  NOT AVAILABLE



  NOT AVAILABLE



running install

running build

running config_cc

unifing config_cc, config, build_clib, build_ext, build commands --compiler options

running config_fc

unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options

running build_src

build_src

building py_modules sources

creating build

creating build\src.win-amd64-2.7

creating build\src.win-amd64-2.7\numpy

creating build\src.win-amd64-2.7\numpy\distutils

building library "npymath" sources

No module named msvccompiler in numpy.distutils; trying from distutils

Running from numpy source directory.

c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\numpy\distutils\system_info.py:1521: UserWarning:

    Atlas (http://math-atlas.sourceforge.net/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [atlas]) or by setting

    the ATLAS environment variable.

  warnings.warn(AtlasNotFoundError.__doc__)

c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\numpy\distutils\system_info.py:1530: UserWarning:

    Blas (http://www.netlib.org/blas/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [blas]) or by setting

    the BLAS environment variable.

  warnings.warn(BlasNotFoundError.__doc__)

c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\numpy\distutils\system_info.py:1533: UserWarning:

    Blas (http://www.netlib.org/blas/) sources not found.

    Directories to search for the sources can be specified in the

    numpy/distutils/site.cfg file (section [blas_src]) or by setting

    the BLAS_SRC environment variable.

  warnings.warn(BlasSrcNotFoundError.__doc__)

c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\numpy\distutils\system_info.py:1427: UserWarning:

    Atlas (http://math-atlas.sourceforge.net/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [atlas]) or by setting

    the ATLAS environment variable.

  warnings.warn(AtlasNotFoundError.__doc__)

c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\numpy\distutils\system_info.py:1438: UserWarning:

    Lapack (http://www.netlib.org/lapack/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [lapack]) or by setting

    the LAPACK environment variable.

  warnings.warn(LapackNotFoundError.__doc__)

c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy\numpy\distutils\system_info.py:1441: UserWarning:

    Lapack (http://www.netlib.org/lapack/) sources not found.

    Directories to search for the sources can be specified in the

    numpy/distutils/site.cfg file (section [lapack_src]) or by setting

    the LAPACK_SRC environment variable.

  warnings.warn(LapackSrcNotFoundError.__doc__)

C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'define_macros'

  warnings.warn(msg)

error: Unable to find vcvarsall.bat

----------------------------------------
Cleaning up...
Command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\zebra\\appdata\\local\\temp\\pip_build_zebra\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\zebra\appdata\local\temp\pip-py_oa_-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in c:\users\zebra\appdata\local\temp\pip_build_zebra\numpy
Storing debug log for failure in C:\Users\zebra\pip\pip.log
Tal Barda
  • 623
  • 1
  • 9
  • 14

6 Answers6

5

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

Björn Lindqvist
  • 19,221
  • 20
  • 87
  • 122
5

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.

Community
  • 1
  • 1
bskp
  • 350
  • 4
  • 12
2

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

Rajesh Kumar
  • 1,270
  • 4
  • 15
  • 31
  • Now I tried to install [mingw-w64](http://sourceforge.net/projects/mingw-w64/files/latest/download) and I have another error, added the `distutils.cfg` file to `C:\Python27\Lib\distutils` with the content of : [build] compiler=mingw32 and throws an error of NotImplementedError: Only MS compiler supported with gfortran on win64 this have a workaround too (download the package manually, change the line that raises the specific error to `pass`) but it still doesn't work:( – Tal Barda Jun 24 '14 at 10:15
  • What is the path you got for that bat file after installing visual c++ 2008 express edition – Rajesh Kumar Jun 24 '14 at 10:16
  • 1
    If I remove the distutils.cfg file, there are other errors, too long to comment here - here is a [share of the pip.log](https://drive.google.com/file/d/0B0uaddrA0_ZmbUltLV94ek5XN1U/edit?usp=sharing).. The last and meaningfull lines in the traceback are : File "C:\Python27\lib\distutils\msvc9compiler.py", line 383, in initialize vc_env = query_vcvarsall(VERSION, plat_spec) File "C:\Python27\lib\distutils\msvc9compiler.py", line 299, in query_vcvarsall raise ValueError(str(list(result.keys()))) ValueError: [u'path'] – Tal Barda Jun 24 '14 at 10:25
  • Try with vc++ 2008 only, now tell me what is the path you got for that bat file after installing vc++2008? – Rajesh Kumar Jun 24 '14 at 10:27
  • download location for vc++2008 express edition is http://go.microsoft.com/?linkid=7729279 – Rajesh Kumar Jun 24 '14 at 10:30
  • It is using msvc9compiler.py file means you did not install the correct version of vc++ or path in environment variable is wrong – Rajesh Kumar Jun 24 '14 at 10:33
  • the path is C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat – Tal Barda Jun 24 '14 at 10:39
  • I looked into the msvc9compiler.py file and I saw that the error is raised from the next query_vcvarsall function code. Now I see it calls the vcvarsall.bat executable, and when I run it manually `vcvarsall.bat x86_amd64` it outputs `The specified configuration type is missing. The tools for the configuration might not be installed.` and when I looked into the `vcvarsall.bat` content I saw it's is looking for `vcvarsx86_amd64.bat` file that is missing – Tal Barda Jun 24 '14 at 10:39
  • that is not the correct path of that file, let me check – Rajesh Kumar Jun 24 '14 at 10:40
  • If you have installed that vcsetup.exe file given from link http://go.microsoft.com/?linkid=7729279, you will get vcvarsall.bat file into the location C:\Program Files (x86)\Microsoft Visual Studio 8\VC – Rajesh Kumar Jun 24 '14 at 10:42
  • Maybe I've downloaded a 32-bit version instead of 64 bit? is [this one](http://www.microsoft.com/en-us/download/details.aspx?id=15336) a good one to download/use [this one](http://www.microsoft.com/en-us/download/details.aspx?id=8279)? – Tal Barda Jun 24 '14 at 10:45
  • Redistributable package will not give that vcvarsall.bat file, download it from the link I have given in above comment – Rajesh Kumar Jun 24 '14 at 10:47
  • I'm pretty sure that's where I've downloaded it ... But I'll uninstall and reinstall – Tal Barda Jun 24 '14 at 10:50
  • You already downloaded vcsetup.exe from http://go.microsoft.com/?linkid=7729279 location ? – Rajesh Kumar Jun 24 '14 at 10:51
  • Are you sure it's form 64bit platform? – Tal Barda Jun 24 '14 at 11:59
  • yes, I tried it worked perfect for me....vcvarsx86_amd64.bat file I have it in VC\bin folder – Rajesh Kumar Jun 24 '14 at 12:00
  • 1
    [here](http://stackoverflow.com/questions/9536357/how-can-i-compile-64-bit-with-visual-c-2008) they say you should install the SDK as well – Tal Barda Jun 24 '14 at 12:04
  • I'm re-installing it and it offers the `C:\Program Files (x86)\Microsoft Visual Studio 9.0\` as the installation folder.. – Tal Barda Jun 24 '14 at 12:06
  • can you run `echo %VS90COMNTOOLS%` in your command prompt to verify what you're saying regarding the installation folder? – Tal Barda Jun 24 '14 at 12:08
  • I got this "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\" – Rajesh Kumar Jun 24 '14 at 12:09
  • so it's not Visual Studio 8 as you said? BTW, look at [this post](http://www.luxrender.net/wiki/Building_on_Windows#Fix_build_environment_batch_files) – Tal Barda Jun 24 '14 at 12:14
0

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"

Prasad DLV
  • 408
  • 4
  • 9
0

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.

user3142459
  • 630
  • 5
  • 18
0

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

Community
  • 1
  • 1