简体   繁体   中英

How do I force my code to use 32-bit Python in a virtual environment?

Title pretty much says it all. Python 2.7.8, OSX 10.8.5 Already tried (separately) all the methods on:

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

and

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

and

export VERSIONER_PYTHON_PREFER_32_BIT=yes

When I jump into the interpreter and run import platform; platform.architecture() import platform; platform.architecture() I still get

('64bit', '') for each one.

sys.maxsize > 2**32 returns True

platform.architecture() is unreliable on OSX, to be sure you're still runing 64 bit and not 32 you should run sys.maxsize > 2**32

https://docs.python.org/2/library/platform.html#platform.architecture

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM