Force Python to be 32 bit on OS X Lion

Posted by sciencectn on Stack Overflow See other posts from Stack Overflow or by sciencectn
Published on 2012-11-12T22:52:14Z Indexed on 2012/11/12 23:00 UTC
Read the original article Hit count: 248

Filed under:
|
|
|

I'm trying to use CPLEX within Python on Mac OS 10.7.5. CPLEX appears to only support a 32 bit python. I'm using this in a python shell to check if it's 32 bit:

import sys,platform; print platform.architecture()[0], sys.maxsize > 2**32

I've tried these 2 commands as suggested in man 1 python, but neither seem to force 32 bit:

export VERSIONER_PYTHON_PREFER_32_BIT=yes
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

The only thing that seems to work is this:

arch -i386 python

However, if I run a script using arch which calls other scripts, they all seem to start up in 64 bit mode. Is there another system wide variable to force it into 32 bit mode?

© Stack Overflow or respective owner

Related posts about python

Related posts about osx-lion