首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >安装numpy for python 3.5时出现问题

安装numpy for python 3.5时出现问题
EN

Stack Overflow用户
提问于 2015-11-26 19:28:54
回答 2查看 1K关注 0票数 2

我已经尝试了2个多小时来为python 3.5安装numpy模块。

由于某些原因,我总是在最后得到这个错误

代码语言:javascript
运行
复制
building library "npymath" sources
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
error: Unable to find vcvarsall.bat

我从其他人那里读到了很多关于这个问题的文章。但似乎想不出怎么帮我解决这个问题。

我有:

Microsoft Visual c++ 2013可再发行版

Microsoft Visual c++ 2012可再发行版

Microsoft Visual c++ 2010可再发行版

任何帮助都是好的!

谢谢

附注:这是完整的输出

代码语言:javascript
运行
复制
C:\David\Temp Files\numpy-1.10.1>python setup.py install
Running from numpy source directory.
C:\Users\David\Python35\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
  warnings.warn(msg)
blas_opt_info:
blas_mkl_info:
  libraries mkl,vml,guide not found in ['C:\\Users\\David\\Python35\\lib', 'C:\\', 'C:\\Users\\David\\Python35\\libs']
  NOT AVAILABLE

openblas_info:
  libraries openblas not found in ['C:\\Users\\David\\Python35\\lib', 'C:\\', 'C:\\Users\\David\\Python35\\libs']
  NOT AVAILABLE

atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
  libraries tatlas not found in ['C:\\Users\\David\\Python35\\lib', 'C:\\', 'C:\\Users\\David\\Python35\\libs']
  NOT AVAILABLE

atlas_3_10_blas_info:
  libraries satlas not found in ['C:\\Users\\David\\Python35\\lib', 'C:\\', 'C:\\Users\\David\\Python35\\libs']
  NOT AVAILABLE

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

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

C:\David\Temp Files\numpy-1.10.1\numpy\distutils\system_info.py:1651: 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__)
blas_info:
  libraries blas not found in ['C:\\Users\\David\\Python35\\lib', 'C:\\', 'C:\\Users\\David\\Python35\\libs']
  NOT AVAILABLE

C:\David\Temp Files\numpy-1.10.1\numpy\distutils\system_info.py:1660: 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__)
blas_src_info:
  NOT AVAILABLE

C:\David\Temp Files\numpy-1.10.1\numpy\distutils\system_info.py:1663: 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__)
  NOT AVAILABLE

non-existing path in 'numpy\\distutils': 'site.cfg'
F2PY Version 2
lapack_opt_info:
openblas_lapack_info:
  libraries openblas not found in ['C:\\Users\\David\\Python35\\lib', 'C:\\', 'C:\\Users\\David\\Python35\\libs']
  NOT AVAILABLE

lapack_mkl_info:
mkl_info:
  libraries mkl,vml,guide not found in ['C:\\Users\\David\\Python35\\lib', 'C:\\', 'C:\\Users\\David\\Python35\\libs']
  NOT AVAILABLE

  NOT AVAILABLE

atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
  libraries tatlas,tatlas not found in C:\Users\David\Python35\lib
  libraries lapack_atlas not found in C:\Users\David\Python35\lib
  libraries tatlas,tatlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries tatlas,tatlas not found in C:\Users\David\Python35\libs
  libraries lapack_atlas not found in C:\Users\David\Python35\libs
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
  NOT AVAILABLE

atlas_3_10_info:
  libraries satlas,satlas not found in C:\Users\David\Python35\lib
  libraries lapack_atlas not found in C:\Users\David\Python35\lib
  libraries satlas,satlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries satlas,satlas not found in C:\Users\David\Python35\libs
  libraries lapack_atlas not found in C:\Users\David\Python35\libs
<class 'numpy.distutils.system_info.atlas_3_10_info'>
  NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in C:\Users\David\Python35\lib
  libraries lapack_atlas not found in C:\Users\David\Python35\lib
  libraries ptf77blas,ptcblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries ptf77blas,ptcblas,atlas not found in C:\Users\David\Python35\libs
  libraries lapack_atlas not found in C:\Users\David\Python35\libs
<class 'numpy.distutils.system_info.atlas_threads_info'>
  NOT AVAILABLE

atlas_info:
  libraries f77blas,cblas,atlas not found in C:\Users\David\Python35\lib
  libraries lapack_atlas not found in C:\Users\David\Python35\lib
  libraries f77blas,cblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries f77blas,cblas,atlas not found in C:\Users\David\Python35\libs
  libraries lapack_atlas not found in C:\Users\David\Python35\libs
<class 'numpy.distutils.system_info.atlas_info'>
  NOT AVAILABLE

C:\David\Temp Files\numpy-1.10.1\numpy\distutils\system_info.py:1552: 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__)
lapack_info:
  libraries lapack not found in ['C:\\Users\\David\\Python35\\lib', 'C:\\', 'C:\\Users\\David\\Python35\\libs']
  NOT AVAILABLE

C:\David\Temp Files\numpy-1.10.1\numpy\distutils\system_info.py:1563: 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__)
lapack_src_info:
  NOT AVAILABLE

C:\David\Temp Files\numpy-1.10.1\numpy\distutils\system_info.py:1566: 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__)
  NOT AVAILABLE

C:\Users\David\Python35\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
  warnings.warn(msg)
C:\Users\David\Python35\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
  warnings.warn(msg)
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
building library "npymath" sources
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
error: Unable to find vcvarsall.bat
EN

回答 2

Stack Overflow用户

发布于 2016-01-13 17:31:32

该问题与VisualStudio (默认)安装有关。

在安装VS 2015社区版本时,您通常选择默认的快速安装,其中不包括语言支持实用程序,包括Python。

所以你应该在一开始就在安装菜单中包含编程语言选项。否则,将安装VC2015,但不会安装Python支持。

票数 0
EN

Stack Overflow用户

发布于 2016-07-17 13:22:38

嗯,构建NumPy不需要MSVC中的Python支持--如果你喜欢Visual Studio,它只是一个让你用MSVC编辑Python文件的接口。NumPy实际上只使用了C++编译器。vcvarsall.bat只是将MSVC构建的环境变量设置为一个方便的函数,当您尝试构建时,NumPy找不到这些变量。我想你是想做一个定制的安装吧?OpenBlas还是什么?只需在线下载一个二进制文件,你可以找到ATLAS build和MKL http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy,然后你就省去了从源代码构建的麻烦(在我看来这是一个主要的麻烦)……哦,顺便说一句,你不能用Visual Studio2013安装Python3.5的任何软件包,它是用Microsoft Visual Studio 2015构建的,所以只要下载2015年的社区版本就行了,如果你要使用python setup.py install编译软件包,你也需要它

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33937500

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档