Numpy 和朋友在 Windows 上使用哪种 Python?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8134609/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 18:28:12  来源:igfitidea点击:

Which Python to use on Windows for Numpy and friends?

pythonwindowsmoduleinstallernumpy

提问by Jan

For research related Python programs, I require Python 2.6 (or 2.7), numpy, scipy and matplotlib. Occasionally, I'm going to use other modules such as mayavi2or numexpr.

对于与研究相关的 Python 程序,我需要 Python 2.6(或 2.7)、numpy、scipy 和 matplotlib。有时,我会使用其他模块,例如mayavi2numexpr

The programs in questions will be exchanged between (Ubuntu) Linux and Windows and can be modified to work across platforms. The setup on the Windows side should resemble the Linux one as closely as possible. Integration with COM, .NET, or the Windows OS is not required.

有问题的程序将在 (Ubuntu) Linux 和 Windows 之间交换,并且可以修改为跨平台工作。Windows 端的设置应尽可能与 Linux 相似。不需要与 COM、.NET 或 Windows 操作系统集成。

I'm aware of the following options:

我知道以下选项:

Which of those will provide me most efficiently with a setup that just works? And how would they differ?

其中哪些可以最有效地为我提供一个有效的设置?他们会有什么不同?

采纳答案by mpathy

The question is old, but the answer nowadays to this question will always be Anaconda, so I thought I provide you a link to it.

这个问题很老,但现在这个问题的答案永远是 Anaconda,所以我想我给你提供了一个链接。

Not only for scientfic purposes - it has all the libraries and tools for this, installed - but its also the best python distribution in general: https://www.anaconda.com/download/

不仅出于科学目的 - 它安装了所有用于此的库和工具 - 而且它还是一般最好的 Python 发行版:https: //www.anaconda.com/download/

回答by DaveP

EDIT 2017-11-4: At this point in time Anacondaseems by far to be the best option. It is multi-platform, doesn't require admin/root permission, and it allows you to install multiple python versions in parallel.

编辑 2017-11-4:此时Anaconda似乎是最好的选择。它是多平台的,不需要管理员/root 权限,它允许您并行安装多个 python 版本。

Original post

原帖

The easiest way to install all the python libraries necessary for scientific computing is to install either Python(x,y) or Enthought Python Distribution (EPD). Both offer a fairly similar set of packages (including numexpr and mayavi2), so it's probably just a matter of personal preference. I prefer Python(x,y) because it is fully open source, whereas EPD is a commercial product with a free edition. You can compare the included packages for EPDand Python(x,y).

安装科学计算所需的所有 Python 库的最简单方法是安装 Python(x,y) 或 Enthought Python Distribution (EPD)。两者都提供了一组相当相似的软件包(包括 numexpr 和 mayavi2),所以这可能只是个人喜好的问题。我更喜欢 Python(x,y) 因为它是完全开源的,而 EPD 是一个免费版本的商业产品。您可以比较包含的EPDPython(x,y) 包

Both these options are much better than using the standard python (or ActiveState) then manually installing all the required scientific packages. Both should work well with code transported from Linux. It's worth mentioning that EPD also has a Linux version, so if you need all packages and versions to be absolutelyidentical between Windows and Linux setups, this might be the way to go.

这两个选项都比使用标准 python(或 ActiveState)然后手动安装所有必需的科学包要好得多。两者都应该适用于从 Linux 传输的代码。值得一提的是,环保署也有Linux版本的,所以如果你需要的所有软件包版本是绝对的Windows和Linux之间设置相同,这可能是要走的路。

Edit:The win32-superpack is a good option if you just want a few basic scientific packages, but if you want more complex things like mayavi, you'd need to install them yourself.

编辑:如果您只需要一些基本的科学软件包,则 win32-superpack 是一个不错的选择,但如果您需要更复杂的东西,例如 mayavi,则需要自己安装它们。

Edit 2013-05-03:

编辑 2013-05-03:

There are now a couple of other options which are also worth considering: winpythonand anaconda

现在有几个其他选项也值得考虑:winpythonanaconda

回答by alexurba

I have used the win32-superpackfrom the official SciPy distribution. It includes Python, NumPy, SciPy, matplotlib, etc. and everything works out of the box.

我使用了官方 SciPy 发行版中的win32-superpack。它包括 Python、NumPy、SciPy、matplotlib 等,一切都开箱即用。

Maybe I should also comment on the packages on your list:

也许我还应该评论您列表中的软件包:

  • The standard Python distribution from Python.org does not include SciPy, as far as I know.
  • The Enthought distribution is installed on some of the computer clusters that I am using. It is linked against the Intel MKL and could be faster for linear algebra than the SciPy one. But it is a commercial package. Python programs developed with the SciPy distribution should, however, run without problems under Enthought, too.
  • I don't know anything about the other two distributions.
  • 据我所知,来自 Python.org 的标准 Python 发行版不包括 SciPy。
  • Enthought 发行版安装在我使用的一些计算机集群上。它与 Intel MKL 相关联,并且在线性代数方面可能比 SciPy 更快。但它是一个商业包。然而,使用 SciPy 发行版开发的 Python 程序也应该在 Enthought 下运行没有问题。
  • 我对其他两个发行版一无所知。