【问题标题】:Getting "error: Unable to find vcvarsall.bat" when running "pip install numpy" on windows7 64bit在 windows7 64 位上运行“pip install numpy”时出现“错误:无法找到 vcvarsall.bat”
【发布时间】:2014-08-14 08:24:22
【问题描述】:

我在windows7 64bit 上运行pip install numpy,我得到error: Unable to find vcvarsall.bat

我已经用 pip 安装了一些软件包,例如pyzmq,pysolr,enum等等,所以我真的不知道哪里出了问题。

唯一可能不同的是我安装了.NET framework version 4.5 -> 我怀疑这可能是原因,因为在某些帖子中我看到它可能与Visual Studio 有关(我没有安装)

完整的错误/回溯:

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

【问题讨论】:

    标签: python windows numpy .net-4.5 pip


    【解决方案1】:

    尝试运行以下命令。我遇到了类似的问题,但对于其他一些模块。运行以下命令后解决。

    python -m pip install -U pip

    pip install -U setuptools

    pip install -U virtualenv

    【讨论】:

      【解决方案2】:

      适用于我的 Windows 7、64 位和 Python 2.7 的过程是直接从 Sourceforge 下载 numpy 的二进制文件。例如。 numpy-1.9.2-win32-superpack-python2.7.exe.

      然后提取 EXE 文件,例如使用 7z。将有三个 EXE 文件,例如numpy-1.9.2-nosse.exe、numpy-1.9.2-sse2.exe、numpy-1.9.2-sse3.exe。

      现在选择合适的。在或多或少的现代处理器上,SSE3 会很好。

      SciPy 使用相同的过程:SF-link

      如果二进制文件适合你,唯一的缺点是你不能通过 pip 更新包。

      【讨论】:

        【解决方案3】:

        在我的 64 位 Windows 上遇到了同样的问题。该问题已通过安装 Microsoft Visual C++ Compiler for Python 2.7 得到解决,Microsoft 将其描述为:

        此包包含为 Python 包生成二进制轮子所需的编译器和一组系统头文件。然后可以在任何 Windows 系统上安装 Python 包的二进制轮,而无需访问 C 编译器。

        如果您需要此编译器包,您将收到的典型错误消息是无法找到 vcvarsall.bat

        ...

        像魅力一样工作。

        【讨论】:

          【解决方案4】:

          对于 64 位系统,这个问题可以通过以下 5 个步骤来解决。 (取自http://springflex.blogspot.in/2014/02/how-to-fix-valueerror-when-trying-to.html

          1. 下载 vcsetup.exe(Visual Studio 2008 Express 安装程序)并从以下位置安装: go.microsoft.com/?linkid=7729279
          2. 从以下位置安装 Microsoft Windows SDK: http://www.microsoft.com/en-us/download/details.aspx?id=24826

            选择安装说明下的网络设置链接以获取安装程序。

          3. 运行安装程序文件 如果不需要,请取消选择示例和文档

          4. 在同一文件夹中创建批处理文件“C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat”的副本并将其重命名为“vcvarsamd64.bat”。

          5. 复制文件“vcvarsamd64.bat”并粘贴到文件夹“C:\Program Files (x86)\Microsoft Visual Studio 9.0/VC/bin/amd64”

          【讨论】:

            【解决方案5】:

            需要下载安装vcsetup.exe(Visual C++ 2008 express edition)文件

            然后将新建的vcvarsall.bat文件路径添加到“PATH”环境变量中。

            确保添加后PATH环境变量中没有特殊符号

            【讨论】:

            • 现在我尝试安装mingw-w64,但出现另一个错误,将distutils.cfg 文件添加到C:\Python27\Lib\distutils,内容为:[build] compiler=mingw32 并抛出NotImplementedError 错误:只有在 win64 上支持 gfortran 的 MS 编译器也有解决方法(手动下载包,将引发特定错误的行更改为 pass)但它仍然不起作用:(
            • 安装visual c++ 2008 express edition后你得到的那个bat文件的路径是什么
            • 如果我删除 distutils.cfg 文件,还有其他错误,这里无法评论 - 这是一个 share of the pip.log.. 回溯中最后和有意义的行是:文件“C: \Python27\lib\distutils\msvc9compiler.py”,第 383 行,在初始化 vc_env = query_vcvarsall(VERSION, plat_spec) 文件“C:\Python27\lib\distutils\msvc9compiler.py”,第 299 行,在 query_vcvarsall 中引发 ValueError(str (list(result.keys()))) ValueError: [u'path']
            • 只用vc++ 2008试试,现在告诉我你安装vc++2008后那个bat文件的路径是什么?
            • here 他们说你也应该安装 SDK
            【解决方案6】:

            也许您想在此处使用预构建的二进制文件:http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy?使用 pip 可能不会产生任何好的结果。原因是numpy根本不能用Visual Studio编译,需要用gcc编译。

            如果你还是真的想编译 numpy,你需要用 Vagrant 设置一个 Linux 机器,并按照这里的官方构建说明:https://github.com/juliantaylor/numpy-vendor

            【讨论】:

              猜你喜欢
              • 2013-11-18
              • 2018-10-29
              • 2015-12-14
              • 1970-01-01
              • 2014-09-07
              • 2017-02-15
              • 2013-09-30
              • 1970-01-01
              相关资源
              最近更新 更多