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

后端 未结 4 1865
旧时难觅i
旧时难觅i 2021-01-12 15:02

I just want to build this on my development machine -- the binary install from Python.org is still 32 bits and installing extensions (MySQLdb, for example) is driving me nut

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-12 15:37

    The simplest solution is pull everything you need from MacPorts:

    $ sudo port selfupdate
    $ sudo port install python26 +no_tkinter -universal py26-mysqldb -universal
    

    That will install python2.6, the MySQLdb adapter, and the necessary MySQL client libraries. I suggest adding the no_tkinter variant unless you really need tkinter; there were some issues with the MacPorts version of Tk on 10.6.

    EDIT: Note, the MacPorts Python will be installed as /opt/local/bin/python2.6. You may need to adjust your shell $PATH to ensure /opt/local/bin is on it before /usr/local/bin and /usr/bin. If you want /opt/local/bin/python to refer to the MacPorts python2.6, do the above and:

    $ sudo port install python_select
    $ sudo python_select python26
    

提交回复
热议问题