py2exe and 64/32 bit windows

Grant Edwards invalid at invalid.invalid
Tue Apr 9 15:45:07 EDT 2013


On 2013-04-09, Ian Kelly <ian.g.kelly at gmail.com> wrote:

>> My "Windows partition" currently has a 64-bit Windows 7 Ultimate
>> installation.
>>
>> I'm told that the executable I generate on that machine won't run on
>> Win7 32-bit installations.  I'm not surprised by that, but I'd like
>> to provide 32-bit operability -- and I'm not sure how one does that.
>>
>>  * If I built an executable on a 32-bit windows system using py2exe,
>>    would it be usable on a 64-bit install?
>
> Yes, 64-bit Windows systems will run 32-bit executables.

OK, that's good to know.

>>  * Is there such a thing as a "fat" Windows binary that will run on
>>    both 32 and 64 bit systems?
>
> With .NET applications you can choose an AnyCPU build target that
> will dynamically select 32-bit or 64-bit at runtime based on the host
> OS, but there is no such feature for native applications like
> CPython.
>
>>  * Or do you build separate 32 and 64 bit binaries and rely on the
>>    installer to pick the right files?  [If Inno Setup can't do that, I
>>    can probably get somebody else to build the installer using
>>    something that can.]
>
> You could do that.  The easiest thing to do though is just to make
> sure that your 64-bit Windows installation is using a 32-bit Python
> installation.  py2exe doesn't really build anything; it just bundles
> your source files up with the Python interpreter, so as long as that
> interpreter is 32-bit the generated exes should be able to run on
> either platform.

Cool, I'll try that.

Are there any drawbacks to running a 32-bit Python install on a 64-bit
machine?

Can you have both 32 and 64 bit Python installed at the same time?

-- 
Grant Edwards               grant.b.edwards        Yow! Is it clean in other
                                  at               dimensions?
                              gmail.com            



More information about the Python-list mailing list