是否可以将便携式 Python 32 位安装升级到 64 位安装?

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

Is it possible to upgrade a portable Python 32 bit install to a 64 bit install?

python64-bit32-bit

提问by TerraCode

I've been working on a single program for a few months now, which now requires some additional functionality. Originally, a 32 bit install was just fine, but since I'm now working with massivematrices in scipy, I simply do not have the required RAM in 32bit.

几个月来我一直在开发一个程序,现在需要一些额外的功能。最初,32 位安装很好,但由于我现在在 scipy 中处理大量矩阵,我根本没有 32 位所需的 RAM。

The other problem I have is that my little project has to be very easily transposeable to new systems belonging to people who have no idea what they're doing and just want to click "run", so I did the whole thing with a portable python install.

我遇到的另一个问题是,我的小项目必须非常容易地转换到属于那些不知道自己在做什么而只想点击“运行”的人的新系统,所以我用便携式 python 完成了整个事情安装。

Would it be possible to "upgrade" my little 2.7 python to 64 bit, or am I condemned to reinstalling every single module in a fresh install?

是否有可能将我的小 2.7 python“升级”到 64 位,或者我是否注定要在全新安装中重新安装每个模块?

回答by sorin

No, it is not possible to upgrade a 32bit Python installation to a 64bit one.

不,不可能将 32 位 Python 安装升级到 64 位。

Still, there is something that you can do in order to speedup installation of a new 64bit version.

尽管如此,您还是可以采取一些措施来加速新 64 位版本的安装。

Run pip freeze > packages.txton the old installation in order to generate a list of all installed packages and their versions.

pip freeze > packages.txt在旧安装上运行以生成所有已安装软件包及其版本的列表。

After you install the new python version, run pip install -r packages.txtin order to install the same version of the packages that you had on the old installation.

安装新的 python 版本后,运行pip install -r packages.txt以安装与旧安装相同版本的软件包。

As I see you use scipy, you may want to have a look at Anaconda. It could save you a lot of time.

我看到你使用scipy,你可能想看看 Anaconda。它可以为您节省很多时间。

回答by PranavElric

make a backup of you "Lib" folder present in your python installation folder. Now when you install your python 64 bit paste this "Lib" folder there. After this, you don't need to install many modules again.

备份python安装文件夹中的“Lib”文件夹。现在,当您安装 python 64 位时,将这个“Lib”文件夹粘贴到那里。在此之后,您不需要再次安装许多模块。