简体   繁体   English

使用Python 3.5在Windows 8.1上安装numpy

[英]Installing numpy on windows 8.1 with python 3.5

I have used numpy and installed it with pip quite often in the past. 我过去经常使用numpy并通过pip安装它。 Never experienced any trouble. 从未遇到过任何麻烦。

However currently I seem to be unable to install numpy. 但是目前我似乎无法安装numpy。 First it claimed that I didn't have a visual studio runtime - so I went ahead and downloaded the current visual studio community edition. 首先,它声称我没有Visual Studio运行时-因此,我继续下载了当前的Visual Studio社区版本。

However this gave again a similar problem, after a long error it ends with: 但是,这又产生了类似的问题,经过长时间的错误后,结果以:

error: Unable to find vcvarsall.bat 错误:找不到vcvarsall.bat

Testing python version information results 测试python版本信息结果

3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MSC v.1900 32 bit (Intel)] 3.5.0(v3.5.0:374f501f4567,2015年9月13日,02:16:59)[MSC v.1900 32位(Intel)]

[EDIT: NEW VERSION TEST]: [编辑:新版本测试]:

3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] 3.5.0(v3.5.0:374f501f4567,2015年9月13日,02:27:37)[MSC v.1900 64位(AMD64)]

My computer runs a near clean version of windows 8.1 (64 bit). 我的计算机运行的是Windows 8.1(64位)的近似全新版本。 (About a week old) (大约一个星期大)

I downloaded "just" the community 2015 version of visual studio (How do I test/get the correct C compiler from microsoft?) - Is this the problem? 我“仅”下载了Visual Studio社区2015版(如何从Microsoft测试/获取正确的C编译器?)-这是问题吗?

Full log: 完整日志:

    Complete output from command c:\users\paul\appdata\local\programs\python\pyt
hon35-32\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\Paul\\A
ppData\\Local\\Temp\\pip-build-ykwi9pgy\\numpy\\setup.py';exec(compile(getattr(t
okenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec')
)" install --record C:\Users\Paul\AppData\Local\Temp\pip-jnstzkd1-record\install
-record.txt --single-version-externally-managed --compile:
    non-existing path in 'numpy\\distutils': 'site.cfg'
    non-existing path in 'numpy\\f2py': 'docs'
    non-existing path in 'numpy\\f2py': 'f2py.1'
    F2PY Version 2
    blas_opt_info:
    blas_mkl_info:
      libraries mkl,vml,guide not found in ['c:\\users\\paul\\appdata\\local\\pr
ograms\\python\\python35-32\\lib', 'C:\\', 'c:\\users\\paul\\appdata\\local\\pro
grams\\python\\python35-32\\libs']
      NOT AVAILABLE

    openblas_info:
      libraries openblas not found in ['c:\\users\\paul\\appdata\\local\\program
s\\python\\python35-32\\lib', 'C:\\', 'c:\\users\\paul\\appdata\\local\\programs
\\python\\python35-32\\libs']
      NOT AVAILABLE

    atlas_3_10_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries tatlas not found in ['c:\\users\\paul\\appdata\\local\\programs\
\python\\python35-32\\lib', 'C:\\', 'c:\\users\\paul\\appdata\\local\\programs\\
python\\python35-32\\libs']
      NOT AVAILABLE

    atlas_3_10_blas_info:
      libraries satlas not found in ['c:\\users\\paul\\appdata\\local\\programs\
\python\\python35-32\\lib', 'C:\\', 'c:\\users\\paul\\appdata\\local\\programs\\
python\\python35-32\\libs']
      NOT AVAILABLE

    atlas_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in ['c:\\users\\paul\\appdata\
\local\\programs\\python\\python35-32\\lib', 'C:\\', 'c:\\users\\paul\\appdata\\
local\\programs\\python\\python35-32\\libs']
      NOT AVAILABLE

    atlas_blas_info:
      libraries f77blas,cblas,atlas not found in ['c:\\users\\paul\\appdata\\loc
al\\programs\\python\\python35-32\\lib', 'C:\\', 'c:\\users\\paul\\appdata\\loca
l\\programs\\python\\python35-32\\libs']
      NOT AVAILABLE

    blas_info:
      libraries blas not found in ['c:\\users\\paul\\appdata\\local\\programs\\p
ython\\python35-32\\lib', 'C:\\', 'c:\\users\\paul\\appdata\\local\\programs\\py
thon\\python35-32\\libs']
      NOT AVAILABLE

    blas_src_info:
      NOT AVAILABLE

      NOT AVAILABLE

    non-existing path in 'numpy\\lib': 'benchmarks'
    lapack_opt_info:
    openblas_lapack_info:
      libraries openblas not found in ['c:\\users\\paul\\appdata\\local\\program
s\\python\\python35-32\\lib', 'C:\\', 'c:\\users\\paul\\appdata\\local\\programs
\\python\\python35-32\\libs']
      NOT AVAILABLE

    lapack_mkl_info:
    mkl_info:
      libraries mkl,vml,guide not found in ['c:\\users\\paul\\appdata\\local\\pr
ograms\\python\\python35-32\\lib', 'C:\\', 'c:\\users\\paul\\appdata\\local\\pro
grams\\python\\python35-32\\libs']
      NOT AVAILABLE

      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
      libraries tatlas,tatlas not found in c:\users\paul\appdata\local\programs\
python\python35-32\lib
      libraries lapack_atlas not found in c:\users\paul\appdata\local\programs\p
ython\python35-32\lib
      libraries tatlas,tatlas not found in C:\
      libraries lapack_atlas not found in C:\
      libraries tatlas,tatlas not found in c:\users\paul\appdata\local\programs\
python\python35-32\libs
      libraries lapack_atlas not found in c:\users\paul\appdata\local\programs\p
ython\python35-32\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\paul\appdata\local\programs\
python\python35-32\lib
      libraries lapack_atlas not found in c:\users\paul\appdata\local\programs\p
ython\python35-32\lib
      libraries satlas,satlas not found in C:\
      libraries lapack_atlas not found in C:\
      libraries satlas,satlas not found in c:\users\paul\appdata\local\programs\
python\python35-32\libs
      libraries lapack_atlas not found in c:\users\paul\appdata\local\programs\p
ython\python35-32\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\paul\appdata\local
\programs\python\python35-32\lib
      libraries lapack_atlas not found in c:\users\paul\appdata\local\programs\p
ython\python35-32\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\paul\appdata\local
\programs\python\python35-32\libs
      libraries lapack_atlas not found in c:\users\paul\appdata\local\programs\p
ython\python35-32\libs
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE

    atlas_info:
      libraries f77blas,cblas,atlas not found in c:\users\paul\appdata\local\pro
grams\python\python35-32\lib
      libraries lapack_atlas not found in c:\users\paul\appdata\local\programs\p
ython\python35-32\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\paul\appdata\local\pro
grams\python\python35-32\libs
      libraries lapack_atlas not found in c:\users\paul\appdata\local\programs\p
ython\python35-32\libs
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE

    lapack_info:
      libraries lapack not found in ['c:\\users\\paul\\appdata\\local\\programs\
\python\\python35-32\\lib', 'C:\\', 'c:\\users\\paul\\appdata\\local\\programs\\
python\\python35-32\\libs']
      NOT AVAILABLE

    lapack_src_info:
      NOT AVAILABLE

      NOT AVAILABLE

    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.win32-3.5
    creating build\src.win32-3.5\numpy
    creating build\src.win32-3.5\numpy\distutils
    building library "npymath" sources
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying f
rom distutils
    Running from numpy source directory.
    C:\Users\Paul\AppData\Local\Temp\pip-build-ykwi9pgy\numpy\numpy\distutils\sy
stem_info.py:1603: 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__)
    C:\Users\Paul\AppData\Local\Temp\pip-build-ykwi9pgy\numpy\numpy\distutils\sy
stem_info.py:1612: 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__)
    C:\Users\Paul\AppData\Local\Temp\pip-build-ykwi9pgy\numpy\numpy\distutils\sy
stem_info.py:1615: 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__)
    C:\Users\Paul\AppData\Local\Temp\pip-build-ykwi9pgy\numpy\numpy\distutils\sy
stem_info.py:1505: 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__)
    C:\Users\Paul\AppData\Local\Temp\pip-build-ykwi9pgy\numpy\numpy\distutils\sy
stem_info.py:1516: 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__)
    C:\Users\Paul\AppData\Local\Temp\pip-build-ykwi9pgy\numpy\numpy\distutils\sy
stem_info.py:1519: 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__)
    c:\users\paul\appdata\local\programs\python\python35-32\lib\distutils\dist.p
y:261: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    error: Unable to find vcvarsall.bat

    ----------------------------------------
Command "c:\users\paul\appdata\local\programs\python\python35-32\python.exe -c "
import setuptools, tokenize;__file__='C:\\Users\\Paul\\AppData\\Local\\Temp\\pip
-build-ykwi9pgy\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(_
_file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\U
sers\Paul\AppData\Local\Temp\pip-jnstzkd1-record\install-record.txt --single-ver
sion-externally-managed --compile" failed with error code 1 in C:\Users\Paul\App
Data\Local\Temp\pip-build-ykwi9pgy\numpy

I see many (years old) posts about this problem but they typically talked about setuptools or python 2.x. 我看到许多关于这一问题的文章,但是他们通常谈论的是setuptools或python2.x。 And they often link to older versions of visual studio - I'd like to not install multiple versions of studio unless it's a necessity. 而且它们经常链接到Visual Studio的旧版本-除非必要,否则我不想安装多个Studio版本。

And community edition installs the MSC 1900 right? 而社区版安装MSC 1900对吗? - Can I test that? -我可以测试一下吗?

edit: Also tested now with the 64 bit version of python (why does it default to 32bit?). 编辑:现在还测试了64位版本的python(为什么默认为32位?)。 - "Same" error. -“相同”错误。

As per this answer , The C++ Common Tools feature has to be selected when installing in Visual Studio. 按照此答案 ,在Visual Studio中安装时必须选择C ++通用工具功能。

VS2015设置

If Visual Studio is already installed, you can add it by reconfiguring it (no need to reinstall everything). 如果已经安装了Visual Studio,则可以通过重新配置它来添加它(无需重新安装所有内容)。

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

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