如何在 Windows 7 上升级我的 Python 版本而无需重新安装所有软件包?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12781929/
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-13 15:55:58  来源:igfitidea点击:

How to upgrade my Python version on Windows 7 without having to re-install all packages?

pythonwindowsupgrade

提问by Puggie

What are the possibilities to upgrade my existing Python installation (in my case from version 3.2.2 to 3.3.0) on my Windows 7 x64 system and not having to re-install all my packages? Is there a convenient/automated solution to do this? I'd like to end up with only one Python version on my system.

在我的 Windows 7 x64 系统上升级我现有的 Python 安装(在我的情况下从版本 3.2.2 到 3.3.0)并且不必重新安装我的所有软件包的可能性有哪些?有没有方便/自动化的解决方案来做到这一点?我想最终在我的系统上只有一个 Python 版本。

回答by cdarke

The problem is chiefly with packages written in C: they will be linked with the 3.2 Python code. It might just be a question of re-linking them, but I have had issues with popular packages like numpy(I currenty can't get that to compile on 3.3).

问题主要在于用 C 编写的包:它们将与 3.2 Python 代码链接。这可能只是重新链接它们的问题,但我遇到了流行包的问题,​​例如numpy(我目前无法在 3.3 上编译)。

The pure Python packages would probably be OK in theory, but honestly, is it worth taking the risk?

理论上,纯 Python 包可能没问题,但老实说,值得冒险吗?

It is safer to load the 3.3 versions of the packages, every time. Stick with 3.2 until you can upgrade everything. You can have more than one version of Python loaded on Windows, I have 2.6, 2.7, 3.2 and 3.3 co-existing. You just have to be careful with %PATH%, assoc, and ftype.

每次都加载 3.3 版本的软件包更安全。坚持使用 3.2,直到您可以升级所有内容。您可以在 Windows 上加载多个版本的 Python,我有 2.6、2.7、3.2 和 3.3 共存。你只需要小心 %PATH%、assoc 和 ftype。