happyhuman
happyhuman

Reputation: 1651

Failing to force Python 2.7.4 to run in 32-bit mode on OS X 10.8.3

I have been trying to force Python 2.7.4 to run in 32-bit mode on OS X 10.8.3 by default. I can get Python to run in 32-bit mode by running python32. But when I try to configure Eclipse+PyDev to run Python, it ends up running in 64-bit mode. I have also tried

export VERSIONER_PYTHON_PREFER_32_BIT=yes

and

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

but neither seem to have any effect on my Python, and it still runs in 64-bit.

I was wondering if anyone has any idea how to permanently run Python 2.7 in 32-bit mode. Alternately, I am open to any solution that makes Eclipse/PyDev use the 32-bit Python.

My Python has been installed in /Library/Frameworks/Python.framework/Versions/2.7 and sys.executable returns /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python on my computer.

Thanks.

Upvotes: 0

Views: 416

Answers (1)

mvo
mvo

Reputation: 689

This made python go to 32-bit:

arch -i386 /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

import ctypes
print ctypes.sizeof(ctypes.c_voidp)

output -> 4

but I had the same issue as you that couldn't setup a permanent solution with environment flags as before.

Upvotes: 1

Related Questions