Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 200
Tal Barda Avatar asked Jun 24 '14 07:06

Tal Barda


People also ask

What does “unable to find vcvarsall bat” mean?

When you see “unable to find vcvarsall.bat”, it means you’re installing a package that has an extension module, but only the source code. “vcvarsall.bat” is part of the compiler in Visual Studio that is necessary to compile the module. As a Windows user, you’re probably used to downloading programs that are ready to run.

What version of Python does pip install on?

The compiler package (though labelled for “Python 2.7”, it works for all of these versions) is detected by setuptools, and so pip install will use it when needed. However, if you are targeting Python 3.3 and 3.4 (and did not have access to Visual Studio 2010), building is slightly more complicated.

What are some of the most common errors in Python?

One of the most common errors you’ll see is this one: As far as errors go, “unable to find vcvarsall.bat” is not the most helpful. What is this mythical batch file? Why do I need it? Where can I get it? How do I help Python find it? When will we be freed from this pain? Let’s look at some answers to these questions.

How to install Scrapy from Pip without any errors?

If anyone gets cl.exe not found or somefile not found error while installing , just install the "Twisted" and "lxml" libraries from unofficial source and u can then easily install Scrapy from pip without errors . link: lfd.uci.edu/~gohlke/pythonlibs/#twisted Try installing this, it's a known workaround for enabling the C++ compiler for Python 2.7.


3 Answers

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

like image 160
Björn Lindqvist Avatar answered Oct 17 '22 00:10

Björn Lindqvist


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.

like image 24
bskp Avatar answered Oct 17 '22 00:10

bskp


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

like image 39
Rajesh Kumar Avatar answered Oct 16 '22 23:10

Rajesh Kumar