在 Mac OS X 10.10 上以 64 位模式执行 python [英] Executing python in 64 bit mode on Mac OS X 10.10

查看:33
本文介绍了在 Mac OS X 10.10 上以 64 位模式执行 python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 64 位模式下执行 python.

I'm trying to execute python on 64 bit mode.

来自这篇文章:如何强制在 Mac OS X 上使用 64 位 python?,我检查了 python 是否有 32/64 位二进制文​​件.

From this post: How to force using 64 bit python on Mac OS X?, I checked that the python has both 32/64 bit binary.

> lipo -info `which python`
> Architectures in the fat file: /usr/bin/python are: x86_64 i386 

但是,当我尝试在 32 位和 64 位模式下使用 python 时,我总是得到 32 位实现,我使用了 如何强制 Python 在 Snow Leopard 和其他 32 位/64 位问题

However, when I tried to use python both in 32 and 64 bit mode, I get always 32bit implementation, I used the hints in 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.

What might be wrong? I use Mac OS X 10.10.2.

推荐答案

根据 Jeff 的评论,我从 brew 安装了 python.

From Jeff's comment, I installed python from brew.

> /usr/local/Cellar/python/2.7.9/bin/python -c 'import sys; print sys.maxint'
9223372036854775807

现在,它至少在 brew 的 python 上运行良好.

Now, it works fine at least with brew's python.

这篇关于在 Mac OS X 10.10 上以 64 位模式执行 python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆