MacportsでPythonのバージョンをそれぞれ入れる。



使ってるMacBookProには標準でPython2.5.1が載ってる。


この2.5系と共存する形で2.6系,3000系を入れたかったので方法を模索。


MacPortsで入れるのが良いみたい。


環境



  • Mac OS 10.5

  • MacPortsがインストールされている事。


Python2.6のインストール


下記を実行。



$ sudo port install python26


このインストールが完了しても標準の2.5.1が起動する(リンクの関係かな?)ので、


複数のPythonを切り替えることができるpython_selectをインストールする。


python_selectのインストール



$ sudo port install python_select


python_selectを使う。


実際にpython_selectを使う。


まずは、切り替える事ができるPythonを確認。



$ python_select -l
Available versions:
current none python25 python25-apple python26


次に切り替えたいバージョンを選択。



$ sudo python_select python26


オプションとか。


$ python_select
usage: python_select [-n] [-d] [-r] [-h] [-v] version

-n Show commands to do selection but do not execute them.
-d Show debug messages during execution
-h Display this help info.
-r Skip test for necessary rights.
-v Display version of python_select.
-l List available options for version.
-s Show the currently selected versio



これでMacで複数のPythonを使いやすくなった♪




参考




追記


windowsの切り替え方法があったら教えて下さい>_<


トラックバック(0)

このブログ記事を参照しているブログ一覧: MacportsでPythonのバージョンをそれぞれ入れる。

このブログ記事に対するトラックバックURL: http://www.rokujyouhitoma.com/mt/mt-tb.cgi/122

あわせて読みたい

  • あわせて読みたいブログパーツ

Lingr java-ja

ウェブページ

Powered by Movable Type 4.1