在 Mac OS X 10.10 上以 64 位模式执行 python
Executing python in 64 bit mode on Mac OS X 10.10
我正在尝试在 64 位模式下执行 python。
从这个 post: How to force using 64 bit python on Mac OS X?,我检查了 python 有两个 32/64 位二进制文件。
> lipo -info `which python`
> Architectures in the fat file: /usr/bin/python are: x86_64 i386
然而,当我尝试在 32 位和 64 位模式下使用 python 时,我总是得到 32 位实现,我使用了 How do I force Python to be 32-bit on Snow Leopard and other 32-bit/64-bit questions
中的提示
> defaults write com.apple.versioner.python Prefer-32-Bit -bool no
> python -c 'import sys; print sys.maxint'
> arch -i386 python -c 'import sys; print sys.maxint'
> defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
> python -c 'import sys; print sys.maxint'
> arch -x86_64 python -c 'import sys; print sys.maxint'
2147483647
2147483647
2147483647
2147483647
可能出了什么问题?我使用 Mac OS X 10.10.2.
根据 Jeff 的评论,我从 brew
安装了 python。
> /usr/local/Cellar/python/2.7.9/bin/python -c 'import sys; print sys.maxint'
9223372036854775807
现在,它至少在 brew 的 python 上运行良好。
我正在尝试在 64 位模式下执行 python。
从这个 post: How to force using 64 bit python on Mac OS X?,我检查了 python 有两个 32/64 位二进制文件。
> lipo -info `which python`
> Architectures in the fat file: /usr/bin/python are: x86_64 i386
然而,当我尝试在 32 位和 64 位模式下使用 python 时,我总是得到 32 位实现,我使用了 How do I force Python to be 32-bit on Snow Leopard and other 32-bit/64-bit questions
中的提示> defaults write com.apple.versioner.python Prefer-32-Bit -bool no
> python -c 'import sys; print sys.maxint'
> arch -i386 python -c 'import sys; print sys.maxint'
> defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
> python -c 'import sys; print sys.maxint'
> arch -x86_64 python -c 'import sys; print sys.maxint'
2147483647
2147483647
2147483647
2147483647
可能出了什么问题?我使用 Mac OS X 10.10.2.
根据 Jeff 的评论,我从 brew
安装了 python。
> /usr/local/Cellar/python/2.7.9/bin/python -c 'import sys; print sys.maxint'
9223372036854775807
现在,它至少在 brew 的 python 上运行良好。