3 回答

TA贡献1998条经验 获得超6个赞
修复与Snow Leopard上的virtualenv一起使用
当我不使用virtualenv时,danielrsmith的答案对我有用,但是virtualenv制作了python可执行文件的一个副本,这导致它不起作用:
$ which python
/Users/cogg/.virtualenvs/tweakeats/bin/python
$ python
[...]
>>> import sys
>>> sys.maxint
9223372036854775807
因为这是python的副本,所以我在其上使用lipo删除了64位体系结构。这使我可以在virtualenv中使用32位python 2.6:
$ lipo -info /Users/cogg/.virtualenvs/tweakeats/bin/python
Architectures in the fat file: /Users/cogg/.virtualenvs/tweakeats/bin/python are: x86_64 i386 ppc7400
$ mv /Users/cogg/.virtualenvs/tweakeats/bin/python /Users/cogg/.virtualenvs/tweakeats/bin/python.old
$ lipo -remove x86_64 /Users/cogg/.virtualenvs/tweakeats/bin/python.old -output /Users/cogg/.virtualenvs/tweakeats/bin/python
$ python
[...]
>>> import sys
>>> sys.maxint
2147483647
添加回答
举报