简体   繁体   中英

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

I just type this in terminal in 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

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..

Cheers.

Numpy makes use of compiled C code to speed some functions up. 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.

On the website, find the version of based on the processor you are using Win 32 or Win 64

numpy-1.11.1+mkl-cp35-cp35m-win32.whl or 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

Why not from numpy site itself ? Because I need some kind of VC compiler from Visual Studio to " properly " install it.

Then in terminal type this ( not sure pip3 or pip3.5 but both work )

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:

pip3 install module 

and also how to update the module : )

Thanks guys.

遵循标准方式: pip3 install numpy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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