简体   繁体   English

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

[英]How to install numpy on freshly installed Python 3.5 in Windows 10?

I just type this in terminal in Pycharm 我只是在Pycharm的终端输入

C:\Users\Me\PycharmProjects\SEMUA>python -m pip install numpy

Then this happen. 然后发生这种情况。

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\

I have downloaded this before typing the command above 在上面输入命令之前,我已经下载了此文件

numpy-1.11.1.zip numpy-1.11.1.zip

but have no idea what to do with it. 但不知道该怎么办。

Please help me or direct me to any link that can explain on how to install numpy or any other module for total newbie/idiot like me.. 请帮助我或将我定向到任何可以解释如何安装numpy或像我这样的新手/白痴的任何其他模块的链接。

Cheers. 干杯。

Numpy makes use of compiled C code to speed some functions up. Numpy利用编译的C代码来加速某些功能。 Your install may fail when the needed compiler is not present in your install environment. 当安装环境中没有所需的编译器时,安装可能会失败。

Christoph Gohlke's website at http://www.lfd.uci.edu/~gohlke/pythonlibs/ provides the compiled version of Numpy for you. Christoph Gohlke的网站http://www.lfd.uci.edu/~gohlke/pythonlibs/为您提供了Numpy的编译版本。

On the website, find the version of based on the processor you are using Win 32 or Win 64 在网站上,找到基于您正在使用Win 32或Win 64的处理器的版本。

numpy-1.11.1+mkl-cp35-cp35m-win32.whl or numpy-1.11.1+mkl-cp35-cp35m-win_amd64.whl numpy-1.11.1 + mkl-cp35-cp35m-win32.whl或numpy-1.11.1 + mkl-cp35-cp35m-win_amd64.whl

Others responses recommended this file as well, but did not provide a means to find it. 其他答复也推荐了此文件,但没有提供找到它的方法。

Good Luck 祝好运

Download this numpy-1.11.1+mkl-cp35-cp35m-win_amd64.whl 下载此numpy-1.11.1 + mkl-cp35-cp35m-win_amd64.whl

Why not from numpy site itself ? 为什么不从numpy网站本身呢? Because I need some kind of VC compiler from Visual Studio to " properly " install it. 因为我需要Visual Studio提供的某种VC编译器来“ 正确 ”安装它。

Then in terminal type this ( not sure pip3 or pip3.5 but both work ) 然后在终端中键入此(不确定pip3或pip3.5,但两者都可以)

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

Question remain is how to set up my python so that I can simply type: 剩下的问题是如何设置我的python,以便我可以简单地键入:

pip3 install module 

and also how to update the module : ) 以及如何更新模块:)

Thanks guys. 多谢你们。

遵循标准方式: pip3 install numpy

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

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