64 位 python 可以创建 32 位 Windows 可执行文件吗 [英] Can 64-bit python create 32-bit Windows executables

查看:60
本文介绍了64 位 python 可以创建 32 位 Windows 可执行文件吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台新的 64 位 Windows 机器并且使用 python 处理各种事情,所以更喜欢安装 64 位 python.

I have a new 64-bit Windows machine and use python for various things and so would prefer to install 64-bit python.

但是,我的一个 python 项目创建了一个 Windows 可执行文件,然后在 32 位 Windows 机器上运行(使用 py2exe 创建).

However, one of my python projects creates a Windows executable that is then run on a 32-bit Windows machine (created using py2exe).

如何使用 64 位 python 和 py2exe 创建 32 位可执行文件?

How do I use 64-bit python and py2exe to create a 32-bit executable?

如果我做不到,我想我的选择是:

If I can't do that, I guess my choices are:

  1. 在所有机器上使用 32 位 python包括我的;或

  1. Use 32-bit python on all machines including mine; or

安装python32 位机器,不要使用py2exe.

Install python on the 32-bit machines and don't use py2exe.

非常感谢任何建议.

推荐答案

您可以在机器上安装 32 位和 64 位 Python,并使用与每次安装关联的 py2exe.

You can install both 32 and 64 bit Python on the machine and use the py2exe associated with each installation.

但是,除非您确实需要额外的 64 位地址空间,否则您最好坚持使用 32 位 Python 以实现兼容性.如果您使用 32 位,您可能会发现 3rd 方模块将具有更好的可用性.

However, unless you actually need the extra address space of 64 bit, then you may as well just stick to 32 bit Python for compatibility. You may well find that 3rd party modules will have better availability if you are using 32 bit.

更新:我写这篇文章已经三年了.我会坚持有关 64 位 Python 的建议吗?大概.确实,64 位第三方模块更容易获得.尤其要感谢 Christoph Gohlke 的精彩网站.

Update: Three years have passed since I wrote this. Would I stick to the advice about 64 bit Python? Probably. It is certainly true that 64 bit third party modules are easier to come by. Not least thanks to Christoph Gohlke's wonderful site.

但情况仍然如此,您会时不时地发现很难获得所需的 64 位版本的扩展.因此,如果您的程序在 32 位进程中运行良好,那么坚持使用 32 位是完全合理的.

But it is still the case the every now and again you'll find it hard to get a 64 bit version of an extension that you need. So, if your program works perfectly well in a 32 bit process, then it is perfectly sound to stick to 32 bit.

这篇关于64 位 python 可以创建 32 位 Windows 可执行文件吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆