标题几乎说明了一切。 Python 2.7.8,OSX 10.8.5已经尝试过(单独)所有方法:
How do I force Python to be 32-bit on Snow Leopard and other 32-bit/64-bit questions
arch -i386 /usr/local/bin/python
和
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
和
export VERSIONER_PYTHON_PREFER_32_BIT=yes
当我跳进解释器并运行import platform; platform.architecture()
时,我仍然得到
('64bit', '')
对于每一个。
sys.maxsize > 2**32
返回True
答案 0 :(得分:1)
platform.architecture()
在OSX上不可靠,为了确保您仍在运行64位而不是32位,您应该运行sys.maxsize > 2**32
https://docs.python.org/2/library/platform.html#platform.architecture