3

我一直在尝试在 Windows 64 位上获取 Python 2.7 的 NumPy,但是每个人都提到的页面http://www.lfd.uci.edu/~gohlke/pythonlibs/没有在我的任何设备上打开。

在其他地方我可以找到它吗?

4

2 回答 2

5

我建议WinPython,一个适用于 Windows 的 Python 2.7 发行版,有 32 位和 64 位版本。

WinPython 创建者的这篇博文解释了为什么通常很难找到 64 位 Windows NumPy:

根据经验丰富的开发人员的说法,Windows 64 位平台没有像样的开源(免费)Fortran 编译器。因此,仅使用免费和开源工具在这个平台上构建 NumPy 或 SciPy 是不可能的。这就是为什么这两个库没有官方的 Windows 64 位二进制文​​件的原因。唯一可用的现成安装程序是由 Christoph Gohlke 准备的(使用 Intel Fortran 编译器,又名“ifort”),这些显然是非官方的二进制文件。此外,Christoph 为 NumPy 构建了两种不同的安装程序:一种未优化,另一种使用英特尔数学内核库 (MKL) 进行了优化,从而提供了更好的性能。Gohlke 的 SciPy 64 位二进制包(唯一可在线免费获得的包)需要 NumPy MKL。问题在于,根据 Christoph Gohlke 的说法,MKL 许可证不允许我(或其他任何人)重新分发这些二进制文件,除非我已经购买了这样的许可证。我仍然不清楚最终用户是否也需要此许可证。希望没有。让我们假设。此外,在仔细阅读英特尔 MKL 许可条款后,我很确定我可以重新分发基于 MKL 构建的 NumPy,因为它只是运行时重新分发。所以我想我会购买一个英特尔 Fortran 编译器许可证(包括 MKL),以便能够在不久的将来重建 NumPy 和 SciPy,但同时我将重新分发由 Christoph Gohlke 构建的包。此外,在仔细阅读英特尔 MKL 许可条款后,我很确定我可以重新分发基于 MKL 构建的 NumPy,因为它只是运行时重新分发。所以我想我会购买一个英特尔 Fortran 编译器许可证(包括 MKL),以便能够在不久的将来重建 NumPy 和 SciPy,但同时我将重新分发由 Christoph Gohlke 构建的包。此外,在仔细阅读英特尔 MKL 许可条款后,我很确定我可以重新分发基于 MKL 构建的 NumPy,因为它只是运行时重新分发。所以我想我会购买一个英特尔 Fortran 编译器许可证(包括 MKL),以便能够在不久的将来重建 NumPy 和 SciPy,但同时我将重新分发由 Christoph Gohlke 构建的包。

于 2013-02-09T03:54:26.993 回答
1

I don't know where else to find it but I'd like to mention that it actually isn't that difficult to build yourself, if you have the numpy source and a MSVC compiler.

Numpy builds using the python distutils package and as such deals with manifest files. If you are using VC9 then you can probably go right ahead.

I did this today using the VC10 compiler, and as such had to alter my distutils package (msvc9compiler.py) to not handle any manifests. I simply commented out those lines. Then before I built the package, I set the env var to point to my actual compiler:

set VS90COMNTOOLS=%VS100COMNTOOLS%
c:\python27_64\python.exe setup.py build

And after the build, I find the numpy package in the build folder.

Numpy complains a lot about ATLAS and BLAS and stuff, but in the end, you'll get a compiled numpy that will run the tests successfully.

于 2013-02-07T22:57:21.847 回答