本文介绍了无法在 Windows 7 下使用 python 2.7 安装 numpy 1.8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了 numpy 1.8 zip 版本,并且我有 python 2.7 和 windows 7.当我这样做时

I have donwloaded numpy 1.8 zip version and I have python 2.7 and windows 7. When I do

python setup.py install

我明白了:

Q:\Users\user\Desktop\numpy-1.8.0>python setup.py install
Running from numpy source directory.
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:\\Python
27\\libs']
  NOT AVAILABLE

openblas_info:
  libraries openblas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\l
ibs']
  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

Q:\Users\user\Desktop\numpy-1.8.0\numpy\distutils\system_info.py:1522: UserWar
ning:
    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:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs'
]
  NOT AVAILABLE

Q:\Users\user\Desktop\numpy-1.8.0\numpy\distutils\system_info.py:1531: UserWar
ning:
    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

Q:\Users\user\Desktop\numpy-1.8.0\numpy\distutils\system_info.py:1534: UserWar
ning:
    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\\lib': 'benchmarks'
lapack_opt_info:
lapack_mkl_info:
mkl_info:
  libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python
27\\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

Q:\Users\user\Desktop\numpy-1.8.0\numpy\distutils\system_info.py:1428: UserWar
ning:
    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:\\Python27\\lib', 'C:\\', 'C:\\Python27\\lib
s']
  NOT AVAILABLE

Q:\Users\user\Desktop\numpy-1.8.0\numpy\distutils\system_info.py:1439: UserWar
ning:
    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

Q:\Users\user\Desktop\numpy-1.8.0\numpy\distutils\system_info.py:1442: UserWar
ning:
    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:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option:
 'define_macros'
  warnings.warn(msg)
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler opti
ons
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler opt
ions
running build_src
build_src
building py_modules sources
building library "npymath" sources
No module named msvccompiler in numpy.distutils; trying from distutils
error: Unable to find vcvarsall.bat

请帮忙.

推荐答案

在 Windows 上从源代码编译有些乏味.我建议您使用预编译的安装程序,例如来自 http://www.lfd.uci 的安装程序.edu/~gohlke/pythonlibs/.或者,您可以安装 PIP,一个 python 包安装程序(例如,可从同一站点获得).使用 PIP,安装包很简单:

Compiling from source is somewhat tedious on Windows. I suggest you use precompiled installers, such as the ones from http://www.lfd.uci.edu/~gohlke/pythonlibs/. Alternatively, you can install PIP, a python package installer (available from the same site, for instance). With PIP, package installation is simple:

pip install numpy

这篇关于无法在 Windows 7 下使用 python 2.7 安装 numpy 1.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 19:47
查看更多