Quantcast
Viewing latest article 3
Browse Latest Browse All 7

[TextMate] Portで入れたPythonで動かない

PythonのコーディングにTextMateを使い始めたのですが、command+Rで実行させた時にどうもSnow Leopardのデフォルトで入ってるPythonで動いているみたいです。
Python2.5とかPython2.6とかを使い分けたいので、Portで入れたPythonを使って欲しいのですが、python_selectで設定しても全く関係無しでデフォルトのやつで動くみたい。

試しに以下のスクリプトを実行すると

import sys
import os

print sys.version
print os.environ['PATH']

Image may be NSFW.
Clik here to view.

ってなってた。
どうやらPATHが素の状態のままっぽいのでちょっと無理矢理感がありますがプロジェクトの設定でPATHに/opt/local/bin:/opt/local/sbin/:/usr/bin:/bin:/usr/sbin って入れてみると
Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Portで入れたPythonが動作しました。


Viewing latest article 3
Browse Latest Browse All 7

Trending Articles