简体   繁体   English

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

[英]problems installing numpy for python 3.5

I have been trying for over 2 hours to install numpy module for python 3.5 我已经尝试了2个多小时来为python 3.5安装numpy模块

for some reason i keep getting this error at the end 由于某种原因,我总是在最后收到此错误

building library "npymath" sources
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
error: Unable to find vcvarsall.bat

I read a lot about this problem from other people. 我从其他人那里读了很多关于这个问题的书。 but can't seem to figure out how to fix it for me. 但似乎无法找出如何为我修复它。

i Have: 我有:

Microsoft Visual c++ 2013 Redistributable Microsoft Visual c ++ 2013可再发行

Microsoft Visual c++ 2012 Redistributable Microsoft Visual c ++ 2012可再发行

Microsoft Visual c++ 2010 Redistributable Microsoft Visual c ++ 2010可再发行

any help will be good! 任何帮助都会很好!

Thanks 谢谢

ps this is the full output 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

The problem is related with VisualStudio (default) installation. 该问题与VisualStudio(默认)安装有关。

While installing VS 2015 Community Version, you normally choose the default express installation, which DOES NOT INCLUDE LANGUAGE SUPPORT UTILITIES, including Python. 在安装VS 2015社区版本时,通常会选择默认的快速安装,该安装不包括语言支持工具,包括Python。

So you should include Programming Languages option in the installation menu at the very beginning. 因此,您应该在一开始就在安装菜单中包括“编程语言”选项。 Otherwise the VC2015 is installed but the Python support is not. 否则,将安装VC2015,但未安装Python支持。

Hmm the Python support in MSVC is not needed to build NumPy - it is just an interface to let you edit Python files using MSVC if you love Visual Studio. 嗯,构建NumPy不需要MSVC中的Python支持-如果您喜欢Visual Studio,它只是一个接口,可让您使用MSVC编辑Python文件。 NumPy actually uses just the C++ compiler. NumPy实际上仅使用C ++编译器。 vcvarsall.bat just sets the environment variables for MSVC builds for you as a convenience function, which NumPy couldn't find while you were trying to build. vcvarsall.bat只是为您将MSVC构建的环境变量设置为便捷功能,而NumPy在您尝试构建时找不到它。 I take it you were trying to make a custom installation? 我认为您正在尝试进行自定义安装? OpenBlas or something? OpenBlas还是什么? Just download a binary online you can find ATLAS builds and MKL http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy , then you save yourself the hassle of building from source (and it is a MAJOR hassle in my opinion)... Oh BTW you can't install any packages for Python 3.5 using Visual Studio 2013, it is built using Microsoft Visual Studio 2015 so just download the 2015 community version if going that route https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx You'll also need it anytime you compile a package with python setup.py install 只需在线下载二进制文件,您就可以找到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