Using Python 3.1 with TextMate

Viewed 17466

TextMate seems to use the built-in Python version I assume (sys.path doesn't work). How do you configure it to use 3.1 instead? I've already installed the 3.1 package and I can use IDLE for interactive sessions, but I need to use TextMate now.

Thanks

5 Answers

I wanted to achieve this in TextMate version 2.0.23 with the aim to use python3 as the default.

So this is how I could set the TM_PYTHON variable (based on @Ned Deily's answer above):

  1. Open Textmate
  2. Hit CMD + ; to open the settings
    enter image description here
  3. Now Add a new Variable with the + sign

4. In the Terminal.app I typed which python3 which gave me /usr/local/bin/python3.

Now whenever I open a python script and hit CMD + R it will execute as a pyhton3 script by default while "honouring" the installed PIP packages.

Related