If you use MacPorts , it is as simple as specifying an option that tells it not to compile Universal, for example:
sudo port install python26 -universal
You can view the available options using the options command:
% port variants python26 python26 has the variants: darwin: Platform variant, selected automatically no_tkinter: Disable Tkinter support, which will break IDLE ucs4: Enable support for UCS4 universal: Build for multiple architectures
As you can see, by default in 10.6 it creates the darwin variant, which builds ONLY x86_64:
% cd /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/ % file python2.6 python2.6: Mach-O 64-bit executable x86_64
Comparison with the default python binary, which is universal:
% file /usr/bin/python /usr/bin/python: Mach-O universal binary with 3 architectures /usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64 /usr/bin/python (for architecture i386): Mach-O executable i386 /usr/bin/python (for architecture ppc7400): Mach-O executable ppc
If you are not using MacPorts, I suggest you consider it. It saves a lot of time and suffering to manually configure and compile everything, and there is an excellent GUI called Porticus . All free and open source, of course!
ps Never replace or rename the original system binaries! As suggested in the comments of Ned Daily:
"Either control access to the python instance by changing the search order in the PATH environment variable or, if necessary, use an absolute path such as / opt / local / bin / python 2.6."
jathanism
source share