Windows 上 Python 3 的基于 Web 的安装程序和可执行的安装程序之间的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38651672/
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
Difference between web-based and executable installers for Python 3 on Windows
提问by prudhvi259
The downloads pagefor Python for Windows offers a "web-based"installer and an "executable"installer. What's the difference?
适用于 Windows 的 Python的下载页面提供了一个“基于网络的”安装程序和一个“可执行的”安装程序。有什么不同?
回答by Readme
This applies to all programs, not just Python:
这适用于所有程序,而不仅仅是 Python:
An executable installerhas every component of the program you're installing locally in the installer itself. This means that you can download the installer on a computer with internet access, copy it over to a computer without internet access and install it there. This is useful if you're installing network card drivers.
一个可执行安装程序有你在安装程序本身在本地安装的程序的每个组件。这意味着您可以在可以访问 Internet 的计算机上下载安装程序,将其复制到无法访问 Internet 的计算机上并在那里安装。如果您正在安装网卡驱动程序,这很有用。
Web-based installersare small programs that when you start them, download the necessary files and install them directly. This means that the installer is very small.
基于 Web 的安装程序是小程序,当您启动它们时,下载必要的文件并直接安装它们。这意味着安装程序非常小。
If you just want to install python on your local computer which has web-access, it doesn't really matter which one you pick.
如果您只想在可以访问网络的本地计算机上安装 python,那么选择哪一个并不重要。
回答by Eddy Current
The distinction made up by Python is completely artificial: both their executable and their web-based installer are executable installers. One for offline use (which contains all the components), the other for online use (which downloads these components during execution). The latter may download and install the current version, while the former will install the version available when you downloaded the executable installer. In general you should but stay away from executable installers: these are almost always vulnerable. Prefer packages for the package installer of your operating system!
Python 造成的区别完全是人为的:它们的可执行文件和基于 Web 的安装程序都是可执行的安装程序。一个用于离线使用(包含所有组件),另一个用于在线使用(在执行期间下载这些组件)。后者可能会下载并安装当前版本,而前者会安装您下载可执行安装程序时可用的版本。一般来说,您应该远离可执行安装程序:这些几乎总是易受攻击的。首选用于您操作系统的软件包安装程序的软件包!
回答by Mark Amery
The extent of the explanation from the official docs is this point included in all the release notes since Python 3.5.0:
自Python 3.5.0以来的所有发行说明中都包含官方文档的解释范围:
Windows users: There are now "web-based" installers for Windows platforms; the installer will download the needed software components at installation time.
Windows 用户:现在有适用于 Windows 平台的“基于 Web”的安装程序;安装程序将在安装时下载所需的软件组件。
As Python contributor Steve Dower notes, the main tradeoff is that the executable installer will work offline while the web-based installer will consume slightly less bandwidth overall (since it can avoid downloading components that you don't need which need to be bundled into the executable installer just in case). However, given that the executable installer is only around 30MB, and that according to Steve the total saving is typically about 3-5MB, it seems to me that this doesn't really matter to anybody; even on 0.34 Mbps internet in Yemen, you'll only save yourself a couple of minutes by using the web-based installer. (For me in London, downloading the executable installer takes about 2 seconds.)
正如Python 贡献者 Steve Dower 所指出的,主要的折衷是可执行安装程序将脱机工作,而基于 Web 的安装程序总体上消耗的带宽略少(因为它可以避免下载不需要的组件,这些组件需要捆绑到可执行安装程序以防万一)。然而,鉴于可执行安装程序只有 30MB 左右,而且根据 Steve 的说法,总节省量通常约为 3-5MB,在我看来,这对任何人来说都无关紧要;即使在也门的 0.34 Mbps 互联网上,使用基于 Web 的安装程序也只会为您节省几分钟时间。(对于我在伦敦,下载可执行安装程序大约需要 2 秒钟。)
So use whichever of the two installers you like, unless you're planning on copying the installer to some machine that has no internet access and running it there, in which case you should use the executable installer.
因此,请使用您喜欢的两个安装程序中的任何一个,除非您计划将安装程序复制到某些无法访问互联网的机器上并在那里运行,在这种情况下,您应该使用可执行安装程序。