如何在Windows 10中新安装的Python 3.5上安装numpy?

时间:2016-07-09 10:25:07

标签: python numpy

我只需在Pycharm

中的终端输入
C:\Users\Me\PycharmProjects\SEMUA>python -m pip install numpy

然后发生这种情况。

Collecting numpy
  Using cached numpy-1.11.1.zip
Installing collected packages: numpy
  Running setup.py install for numpy ... error
    Complete output from command C:\Users\Me\AppData\Local\Programs\Python\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Me\\AppData\\Local\\Temp\\pip-bu
ild-cj5a_4hi\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Me\AppData\Local\Temp
\pip-qkawsiyj-record\install-record.txt --single-version-externally-managed --compile:
    Running from numpy source directory.

    Note: if you need reliable uninstall behavior, then install
    with pip instead of using `setup.py install`:

      - `pip install .`       (from a git repo or downloaded source
                               release)
      - `pip install numpy`   (last Numpy release on PyPi)


    blas_opt_info:
    blas_mkl_info:
      libraries mkl,vml,guide not found in ['C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\lib', 'C:\\', 'C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\libs'
]
      NOT AVAILABLE

    openblas_info:
      libraries openblas not found in ['C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\lib', 'C:\\', 'C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\libs']
      NOT AVAILABLE

    atlas_3_10_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries tatlas not found in ['C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\lib', 'C:\\', 'C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\libs']
      NOT AVAILABLE

    atlas_3_10_blas_info:
      libraries satlas not found in ['C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\lib', 'C:\\', 'C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\libs']
      NOT AVAILABLE

    atlas_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in ['C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\lib', 'C:\\', 'C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Pytho
n35\\libs']
      NOT AVAILABLE

    atlas_blas_info:
      libraries f77blas,cblas,atlas not found in ['C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\lib', 'C:\\', 'C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\
\libs']
      NOT AVAILABLE

    C:\Users\Me\AppData\Local\Temp\pip-build-cj5a_4hi\numpy\numpy\distutils\system_info.py:1646: 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\\Me\\AppData\\Local\\Programs\\Python\\Python35\\lib', 'C:\\', 'C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\libs']
      NOT AVAILABLE

    C:\Users\Me\AppData\Local\Temp\pip-build-cj5a_4hi\numpy\numpy\distutils\system_info.py:1655: 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:\Users\Me\AppData\Local\Temp\pip-build-cj5a_4hi\numpy\numpy\distutils\system_info.py:1658: 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\\Me\\AppData\\Local\\Programs\\Python\\Python35\\lib', 'C:\\', 'C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\libs']
      NOT AVAILABLE

    lapack_mkl_info:
    mkl_info:
      libraries mkl,vml,guide not found in ['C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\lib', 'C:\\', 'C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\libs'
]
      NOT AVAILABLE

      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
      libraries tatlas,tatlas not found in C:\Users\Me\AppData\Local\Programs\Python\Python35\lib
      libraries lapack_atlas not found in C:\Users\Me\AppData\Local\Programs\Python\Python35\lib
      libraries tatlas,tatlas not found in C:\
      libraries lapack_atlas not found in C:\
      libraries tatlas,tatlas not found in C:\Users\Me\AppData\Local\Programs\Python\Python35\libs
      libraries lapack_atlas not found in C:\Users\Me\AppData\Local\Programs\Python\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\Me\AppData\Local\Programs\Python\Python35\lib
      libraries lapack_atlas not found in C:\Users\Me\AppData\Local\Programs\Python\Python35\lib
      libraries satlas,satlas not found in C:\
      libraries lapack_atlas not found in C:\
      libraries satlas,satlas not found in C:\Users\Me\AppData\Local\Programs\Python\Python35\libs
      libraries lapack_atlas not found in C:\Users\Me\AppData\Local\Programs\Python\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\Me\AppData\Local\Programs\Python\Python35\lib
      libraries lapack_atlas not found in C:\Users\Me\AppData\Local\Programs\Python\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\Me\AppData\Local\Programs\Python\Python35\libs
      libraries lapack_atlas not found in C:\Users\Me\AppData\Local\Programs\Python\Python35\libs
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE

    atlas_info:
      libraries f77blas,cblas,atlas not found in C:\Users\Me\AppData\Local\Programs\Python\Python35\lib
      libraries lapack_atlas not found in C:\Users\Me\AppData\Local\Programs\Python\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\Me\AppData\Local\Programs\Python\Python35\libs
      libraries lapack_atlas not found in C:\Users\Me\AppData\Local\Programs\Python\Python35\libs
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE

    C:\Users\Me\AppData\Local\Temp\pip-build-cj5a_4hi\numpy\numpy\distutils\system_info.py:1548: 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\\Me\\AppData\\Local\\Programs\\Python\\Python35\\lib', 'C:\\', 'C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python35\\libs']
      NOT AVAILABLE

    C:\Users\Me\AppData\Local\Temp\pip-build-cj5a_4hi\numpy\numpy\distutils\system_info.py:1559: 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:\Users\Me\AppData\Local\Temp\pip-build-cj5a_4hi\numpy\numpy\distutils\system_info.py:1562: 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\Me\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py:261: 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 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-3.5
    creating build\src.win-amd64-3.5\numpy
    creating build\src.win-amd64-3.5\numpy\distutils
    building library "npymath" sources
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    error: Unable to find vcvarsall.bat

    ----------------------------------------
Command "C:\Users\Me\AppData\Local\Programs\Python\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Me\\AppData\\Local\\Temp\\pip-build-cj5a_4hi\\numpy\\set
up.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Me\AppData\Local\Temp\pip-qkawsiyj-record\ins
tall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Me\AppData\Local\Temp\pip-build-cj5a_4hi\numpy\

我在输入上面的命令之前已经下载了这个

  

numpy-1.11.1.zip

但不知道该如何处理它。

请帮助我或指导我任何可以解释如何安装numpy或任何其他模块的链接,如我这样的新手/白痴..

干杯。

3 个答案:

答案 0 :(得分:1)

Numpy利用已编译的C代码来加速某些功能。如果安装环境中不存在所需的编译器,则安装可能会失败。

Christoph Gohlke在http://www.lfd.uci.edu/~gohlke/pythonlibs/的网站为您提供Numpy的编译版本。

在网站上,找到基于您使用Win 32或Win 64

的处理器的版本

numpy的-1.11.1 + MKL-CP35-cp35m-win32.whl 要么   numpy的-1.11.1 + MKL-CP35-cp35m-win_amd64.whl

其他人回复推荐此文件,但没有提供找到它的方法。

祝你好运

答案 1 :(得分:0)

下载此内容 numpy-1.11.1+mkl-cp35-cp35m-win_amd64.whl

为什么不从numpy网站本身?因为我需要某种VC compiler from Visual Studio到&#34; 正确&#34;安装它。

然后在终端类型中(不确定pip3或pip3.5,但两者都有效)

pip3 install /full/path/to/numpy-1.11.1+mkl-cp35-cp35m-win_amd64.whl

问题仍然是如何设置我的python,以便我只需输入:

pip3 install module 

以及如何更新模块:)

谢谢你们。

答案 2 :(得分:-2)

遵循标准方式:pip3 install numpy