How to force using 64 bit python on Mac OS X?

空扰寡人 提交于 2019-12-05 18:15:35

Try using arch(1), and supply the specific version of Python:

arch -x86_64 /usr/bin/python2.6

Actually the system should choose the first suitable architecture for you. As

$ file /usr/bin/python2.5
/usr/bin/python2.5: Mach-O universal binary with 2 architectures
/usr/bin/python2.5 (for architecture i386): Mach-O executable i386
/usr/bin/python2.5 (for architecture ppc7400):  Mach-O executable ppc

$ file /usr/bin/python2.6
/usr/bin/python2.6: Mach-O universal binary with 3 architectures
/usr/bin/python2.6 (for architecture x86_64):   Mach-O 64-bit executable x86_64
/usr/bin/python2.6 (for architecture i386): Mach-O executable i386
/usr/bin/python2.6 (for architecture ppc7400):  Mach-O executable ppc

If that python somehow chooses 2.5, then you can't use 64-bit, but if it chooses 2.6 then the x86_64 variant should be automatically selected, as commented below. If it's the former, try to get python_select and change the version to 2.6.

Okay, be REALLY careful when you do this, it's going to require other things to also be 64-bit. All of a sudden, if mod_python won't work, then you need to recompile apache. Then all your python modules like tkinter/tix. If you're on 10.5 like me, don't go there, just live with 32-bit for it.

And if you don't know about http://www.macports.org/ then remember that it's your friend. :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!