Hey, Giovanni,
Thanks for the reply, that clears up a lot.
Keryx (the app I'm working on) is a portable package manager for
Debian-based systems, so it is only concerned with the OS's
architecture.
One fix we thought of is to read the output of 'apt-get -v' which
provides architecture info. The only disadvantage is that the APT
folks may change the output on us and throw Keryx off. That's why we
hesitate to use that.
Perhaps a more reliable alternative would be:
"""
if struct.calcsize("P") == 4:
os_arch = '32bit'
elif struct.calcsize("P") == 8:
os_arch = '64bit'
"""
We're not sure how that works, but it it seems to, when run from
source. Would this always return '32bit' if compiled on a 32-bit
machine?
On Tue, Mar 9, 2010 at 6:50 AM, Giovanni Bajo <[email protected]> wrote:
> On 3/8/2010 3:43 AM, mac9416 wrote:
>>
>> Hi all,
>>
>> platform.architecture() returns 32-bit and 64-bit on their respective
>> OSs when run from source. But when compiled with Pyinstaller on a
>> 32-bit OS, it returns 32-bit when run on either architecture. Is there
>> any way to work around this?
>
> platform.architecture() looks at the binary that you are running. If you
> compile with PyInstaller on a 32-bit system, you end up with a 32-bit
> binary, whatever system you run it on. It basically tells you that you are
> running a 32-bit version of Python, not whether the platform is capable of
> 64-bit or not.
>
> This would be the same if you copied over a 32-bit python installed onto a
> 64-bit operating system.
>
> So you probably want to use a different function. Notice that there are also
> two additional layers beneath Python: OS (which can be either 32-bit or
> 64-bit) and CPU (which can be either 32-bit or 64-bit). Since it is
> perfectly normal to run a 32-bit OS on a 64-bit capable CPU, you will have
> to decide which bit of information you are really interested into.
> --
> Giovanni Bajo
> Develer S.r.l.
> http://www.develer.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/pyinstaller?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyinstaller?hl=en.