在64位Windows上安装NumPy和SciPy(使用Pip) [英] Installing NumPy and SciPy on 64-bit Windows (with Pip)

查看:315
本文介绍了在64位Windows上安装NumPy和SciPy(使用Pip)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现在64位Windows上无法通过安装程序安装NumPy/SciPy,而只能在32位上安装.因为我需要的内存比32位安装所能提供的更多,所以我需要所有内容的64位版本.

I found out that it's impossible to install NumPy/SciPy via installers on Windows 64-bit, that's only possible on 32-bit. Because I need more memory than a 32-bit installation gives me, I need the 64-bit version of everything.

我试图通过Pip安装所有内容,并且大多数工作正常.但是,当我来到SciPy时,它抱怨缺少一个Fortran编译器.因此,我通过MinGW/MSYS安装了Fortran.但是之后您不能立即安装SciPy,需要重新安装NumPy.所以我尝试了一下,但是现在通过Pipeasy_install都不再起作用了.两者都给出以下错误:

I tried to install everything via Pip and most things worked. But when I came to SciPy, it complained about missing a Fortran compiler. So I installed Fortran via MinGW/MSYS. But you can't install SciPy right away after that, you need to reinstall NumPy. So I tried that, but now it doesn't work anymore via Pip nor via easy_install. Both give these errors:

  • 关于LNK2019LNK1120的错误很多.
  • 我在C范围内遇到很多错误:C2065, C2054 , C2085 , C2143`,等等.我认为它们属于同一类.
  • 没有找到Fortran链接器,但是我不知道如何安装它,找不到任何内容.
  • 我的cmd-windows的可见部分中已经出现了许多错误...
  • 致命错误约为LNK1120:

  • There are a lot of errors about LNK2019 and LNK1120,.
  • I get a lot of errors in the range of C: C2065,C2054,C2085,C2143`, etc. They belong together I believe.
  • There is no Fortran linker found, but I have no idea how to install that, can't find anything on it.
  • And many more errors which are already out of the visible part of my cmd-windows...
  • The fatal error is about LNK1120:

build \ lib.win-amd64-2.7 \ numpy \ linalg \ lapack_lite.pyd:致命错误LNK1120:7个未解决的外部组件 错误:退出安装脚本并出现错误:命令"C:\ Users \ me \ AppData \ Local \ Programs \ Common \ Microsoft \ Visual C ++ for Python \ 9.0 \ VC \ Bin \ amd64 \ link.exe/DLL/nologo/INCREMENTAL:否/LIBPATH:C:\ BLAS/LIBPATH:C:\ Python27 \ libs/LIBPATH:C:\ Python27 \ PCbuild \ amd64/LIBPATH:build\temp.win-amd64-2.7 lapack.lib blas.lib/EXPORT:initlapack_lite build \ temp.win-amd64-2.7 \ Release \ numpy \ linalg \ lapack_litemodule.obj/OUT:build\lib.win-amd64-2.7\numpy\linalg\lapack_lite.pyd/IMPLIB:build\temp.win-amd64- 2.7 \ Release \ numpy \ linalg \ lapack_lite.lib/MANIFESTFILE:build\temp.win-amd64-2.7\Release\numpy\linalg\lapack_lite.pyd.manifest失败,退出状态为1120

build\lib.win-amd64-2.7\numpy\linalg\lapack_lite.pyd : fatal error LNK1120: 7 unresolved externals error: Setup script exited with error: Command "C:\Users\me\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\BLAS /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild\amd64 /LIBPATH:build\temp.win-amd64-2.7 lapack.lib blas.lib /EXPORT:initlapack_lite build\temp.win-amd64-2.7\Release\numpy\linalg\lapack_litemodule.obj /OUT:build\lib.win-amd64-2.7\numpy\linalg\lapack_lite.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\numpy\linalg\lapack_lite.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\numpy\linalg\lapack_lite.pyd.manifest" failed with exit status 1120

在64位Windows计算机上安装64位版本的NumPy和SciPy的正确方法是什么?我有什么想念的吗?我是否需要在某处指定内容?对于Windows,我没有找到关于这些问题的信息,仅针对Linux或Mac OS X,但是它们对我没有帮助,因为我无法使用其命令.

What is the correct way to install the 64-bit versions NumPy and SciPy on a 64-bit Windows machine? Did I miss anything? Do I need to specify something somewhere? There is no information for Windows on these problems that I can find, only for Linux or Mac OS X, but they don't help me as I can't use their commands.

推荐答案

Numpy项目现在提供了wheel格式的预编译软件包(软件包格式允许以二进制形式在软件包中进行编译),因此现在的安装方式为和其他软件包一样简单.

The Numpy project now provides pre-compiled packages in the wheel format (package format enabling compiled code as binary in packages), so the installation is now as easy as with other packages.

Numpy(还有一些其他软件包,如Scipy,Pandas等)包括很多C-,Cython和Fortran代码,在使用它们之前需要进行正确编译.顺便说一句,这也是这些Python软件包提供如此快速的线性代数的原因.

Numpy (as also some other packages like Scipy, Pandas etc.) includes lot's of C-, Cython, and Fortran code that needs to be compiled properly, before you can use it. This is, btw, also the reason why these Python-packages provide such fast Linear Algebra.

要获取Windows的预编译包,请查看 Gohlke的非官方Windows二进制文件或使用类似 Winpython 的发行版(可以正常使用)或

To get precompiled packages for Windows, have a look at Gohlke's Unofficial Windows Binaries or use a distribution like Winpython (just works) or Anaconda (more complex) which provide an entire preconfigured environment with lots of packages from the scientific python stack.

这篇关于在64位Windows上安装NumPy和SciPy(使用Pip)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆