[CentralOH] Python bit size

Morgan Goose morgan.goose at gmail.com
Tue May 10 21:34:46 CEST 2011


Looks like it defaults to using 64 bit, but a cli flag will force you to use
32.
   http://www.jaharmi.com/2009/08/29/python_32_bit_execution_on_snow_leopard


goose
On Tue, May 10, 2011 at 03:23:28PM -0400, Mark Erbaugh wrote:
>    On May 10, 2011, at 2:00 PM, m g wrote:
> 
>            import platform
> 
>            platform.architecture()
> 
>      ('32bit', 'ELF')
> 
>      On Tue, May 10, 2011 at 1:29 PM, Mark Erbaugh <[1]mark at microenh.com>
>      wrote:
> 
>        Is there a way to determine whether python is running in 32-bit or
>        64-bit mode?
> 
>    Miles,
>    Thanks for the reply, but this doesn't appear to work on a Mac with Snow
>    Leopard.  Apparently, the default Python that comes with SL is a universal
>    binary containing both 32 and 64 bit versions.  By using the arch command
>    or setting an environment variable (VERSIONER_PYTHON_PREFER_32_BIT), you
>    can force Python to load either as 32 or 64 bit.  I know that I'm getting
>    different versions because sys.maxint returns different values (2147483647
>    for 32-bit and 9223372036854775807 for 64-bit), but on my Mac
>    platform.architecture() always returns ('64bit', ''). I think it's telling
>    me that the OS is 64-bit.
>    This is important to me because the default version of wxPython that comes
>    with Snow Leopard only supports 32-bit. If you do an import wx with 64-bit
>    python, you get a nice error message. If you do it with 32-bit python, it
>    works fine.  FWIW, wxPython now supports 64-bit python but pre-built
>    installs are only available for Python 2.7 and later, the default Python
>    on Snow Leopard is 2.6.
>    Mark
> 
> References
> 
>    Visible links
>    1. mailto:mark at microenh.com

> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> http://mail.python.org/mailman/listinfo/centraloh

---end quoted text---


More information about the CentralOH mailing list