Python 的哪些版本可以在 Windows XP 中运行?

What versions of Python will work in Windows XP?

我想要仍可在 Windows XP 上运行的 Python 最高级版本。我需要 Python 2 和 Python 3.

哪些 Python 版本可以在 Windows XP 上运行?

其中任何一个,python 都非常独立于平台。某些功能可能无法使用,但最好在文档中找到。

我发现 Python 2.7.9 和 Python 3.4.4 是可在 Windows XP 中运行的 Python 的最新版本。我通过反复试验发现了这一点。

我找到了一个绝望的人 (Daniel Pistelli),他在 windows 错误对话框中没有放弃:

https://ntcore.com/?p=458

我喜欢他处理这个话题的方式:

If we try to start any new application on XP, we’ll get an error message informing us that it is not a valid Win32 application. This happens because of some fields in the Optional Header of the Portable Executable.

[...]

Fortunately, it’s enough to adjust the fields in the executable we want to start (python.exe), there’s no need to adjust the DLLs as well. If we try run the application now, we’ll get an error message due to a missing API in kernel32. So let’s turn our attention to the imports.

然后他继续进行另外 5-6 个屏幕。总而言之,显然您必须:

  • 修改python.exeheader,
  • 运行 一个很小的 ​​Python 脚本来重新映射一些 DLL 调用,
  • 重新计算一些二进制哈希,
  • 创建一个假的 kernel32.dll 并转发某些呼叫,
  • 修改python37.dll指向这个假的东西,

然后一切就绪。老实说,我不能完全遵循(更不用说验证!)一些步骤,但它看起来是合法的,并且有与 Daniel 的 half-baked 解决方案的链接,用于较难的部分,还有很多 Python 来源解释。我一定会试试这个东西。

事实上,这是来自他的 GitHub 页面的最终脚本: https://github.com/dpistelli/xptmrt

这个故事的寓意:你可以发疯,但你永远不会发疯 dismantle-all-dlls-and-exes-and-open-hexeditors-and-disassemble-hashing-algorithms-and-mock-it-all-together-so-it-works-under-xp-crazy!

我试过 3.3.3,但我想出了一条错误消息,使用 3.4.3/2.7.9,遗憾的是,它们是现在唯一可用的版本

有人构建了 Python 3.4.10,它比 Windows XP 官方规定的 Python3 v3.4.3/3.4.4 稍新。由于来自第三方(非官方Python网站),使用风险自负,

-->Download<--