Macでデフォルトで入ってるPythonと違うものを使いたくて、通常使うpythonを変更する設定をしたのでメモ。
調べてたらpython_selectっての使うとできるらしかったんだけど2011年5月からpython_selectは使えなくなったみたい。これからは代わりにport selectを使用するようなのでその方法でやる。
環境
- 10.6 lion
- portが使える状態
やり方
設定できるPythonを確認
$ port select --list python Available versions for python: none (active) python25-apple python26 python26-apple python27-apple
現在選択中のものは(active)ってついてます
で、好きなものに変更
$ sudo port select --set python python26
試しにpython起動してみる
$ python Python 2.6.7 (r267:88850, Oct 30 2011, 19:00:25) [GCC 4.2.1 Compatible Apple Clang 3.0 (tags/Apple/clang-211.10.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>
わーい変わったー