简体   繁体   English

如何强制我的代码在虚拟环境中使用32位Python?

[英]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: 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 如何在Snow Leopard和其他32位/ 64位问题上强制Python为32位

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() import platform; platform.architecture() I still get import platform; platform.architecture()我还是得到了

('64bit', '') for each one. ('64bit', '')每一个。

sys.maxsize > 2**32 returns True sys.maxsize > 2**32返回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 platform.architecture()在OSX上是不可靠的,为了确保你仍然运行64位而不是32你应该运行sys.maxsize > 2**32

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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