Thursday, December 8, 2011

Changing python version used by Textmate

The python version that is used by Textmate when you use Command-R to run a python program may be different from the version that is used when you run the program from the command line. This post explains how to make Textmate use the latter python version, if you prefer to do so.

  1. Go the terminal and at the prompt, type which python and press Enter.
  2. Copy the path that you get as a result.
  3. Go to Textmate and go to Preferences → Advanced → Shell variables.
  4. See if a variable TM_PYTHON is listed here. If so, change its value to the value you copied in Step 2. If not, press + to add a variable. Type TM_PYTHON for variable name and the copied path for Value.
Command-R in Textmate should now use the same Python version that is used when you run the program from the command line.

No comments:

Post a Comment