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

查看:37
本文介绍了在 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.所以我试过了,但现在它不再通过 Pip 或通过 easy_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、C2054C2085C2143`,等等.我相信它们属于一起.
  • 没有找到 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:

buildlib.win-amd64-2.7 umpylinalglapack_lite.pyd:致命错误 LNK1120:7 个未解析的外部错误:安装脚本退出并出现错误:命令C:UsersmeAppDataLocalProgramsCommonMicrosoftVisual C++ for Python9.0VCBinamd64link.exe/DLL/nologo/INCREMENTAL:否/LIBPATH:C:BLAS/LIBPATH:C:Python27libs/LIBPATH:C:Python27PCbuildamd64/LIBPATH:build emp.win-amd64-2.7 lapack.lib blas.lib/EXPORT:initlapack_litebuild emp.win-amd64-2.7Release umpylinalglapack_litemodule.obj/OUT:buildlib.win-amd64-2.7 umpylinalglapack_lite.pyd/IMPLIB:build emp.win-amd64-2.7Release umpylinalglapack_lite.lib/MANIFESTFILE:build emp.win-amd64-2.7Release umpylinalglapack_lite.pyd.manifest"失败,退出状态为 1120

buildlib.win-amd64-2.7 umpylinalglapack_lite.pyd : fatal error LNK1120: 7 unresolved externals error: Setup script exited with error: Command "C:UsersmeAppDataLocalProgramsCommonMicrosoftVisual C++ for Python9.0VCBinamd64link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:BLAS /LIBPATH:C:Python27libs /LIBPATH:C:Python27PCbuildamd64 /LIBPATH:build emp.win-amd64-2.7 lapack.lib blas.lib /EXPORT:initlapack_lite build emp.win-amd64-2.7Release umpylinalglapack_litemodule.obj /OUT:buildlib.win-amd64-2.7 umpylinalglapack_lite.pyd /IMPLIB:build emp.win-amd64-2.7Release umpylinalglapack_lite.lib /MANIFESTFILE:build emp.win-amd64-2.7Release umpylinalglapack_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(正常工作)或 Anaconda(更复杂),它提供了一个完整的预配置环境,其中包含大量来自科学 Python 堆栈的包.

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天全站免登陆