繁体   English   中英

在安装python 3.5的numpy时遇到问题

[英]problems installing numpy for python 3.5

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

由于某种原因,我总是在最后收到此错误

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可再发行

任何帮助都会很好!

谢谢

ps这是完整的输出

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

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

在安装VS 2015社区版本时,通常会选择默认的快速安装,该安装不包括语言支持工具,包括Python。

因此,您应该在一开始就在安装菜单中包括“编程语言”选项。 否则,将安装VC2015,但未安装Python支持。

嗯,构建NumPy不需要MSVC中的Python支持-如果您喜欢Visual Studio,它只是一个接口,可让您使用MSVC编辑Python文件。 NumPy实际上仅使用C ++编译器。 vcvarsall.bat只是为您将MSVC构建的环境变量设置为便捷功能,而NumPy在您尝试构建时找不到它。 我认为您正在尝试进行自定义安装? OpenBlas还是什么? 只需在线下载二进制文件,您就可以找到ATLAS版本和MKL http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy ,然后您就可以避免从源代码进行构建的麻烦(这是一个主要的麻烦我的意见)...哦,顺便说一句,您不能使用Visual Studio 2013安装任何适用于Python 3.5的软件包,它是使用Microsoft Visual Studio 2015构建的,因此,如果使用https://www.visualstudio ,请下载2015社区版本。 com / en-us / products / visual-studio-community-vs.aspx使用python setup.py install编译软件包时,您也将需要它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM