osx - How to build 64-bit Python on OS X 10.6 -- ONLY 64 bit, no Universal nonsense -


i want build on development machine -- binary install python.org still 32 bits , installing extensions (mysqldb, example) driving me nuts trying figure out proper flags each , every extension.

clarification: did not replace system python, installed python.org binary normal place @ /library/..., not /system/library/....

everything else seems build 64 bit default, , default python 2.6.1 64 bit (before replaced python.org build figuring direct replacement)`

i want 64 bit build run on 1 machine without cruft.

does have simple answer?

thanks much, ssteinerx@gmail.com

if happen using macports, it's simple specifying variant tells not compile universal, so:

sudo port install python26 -universal 

you can view available variants using variants command:

% port variants python26                                                         python26 has variants:    darwin: platform variant, selected automatically    no_tkinter: disable tkinter support, break idle    ucs4: enable support ucs4    universal: build multiple architectures 

as can see, default on 10.6 builds darwin variant, builds 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 

compare default python binary, universal:

% file /usr/bin/python /usr/bin/python: mach-o universal binary 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're not using macports, suggest consider it. saves lot of time , heartache having manually configure , compile everything, , there excellent gui interface called porticus. free , open source, of course!

p.s. never replace or rename original system binaries! suggested in comments ned daily:

"either manage access intended python instance changing search order in path environment variable or, if necessary, use absolute path /opt/local/bin/python2.6".


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -