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

查看:594
本文介绍了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创建一个Windows可执行文件。 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


的32位计算机上安装python,不要使用
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位,则第三方模块将具有更好的可用性。

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天全站免登陆