Sublime Forum

OSX: Python Version in Sublime is diff than in Terminal

#1

I have modified my python installation on OSX Lion and installed EPD (Enthought Python Distribution). My PATH variable has been set correctly in my .profile and when I execute python from a Terminal the correct version of python is launched. Sublime, however, is still using the system python. What settings do I need to change?

0 Likes

#2

bump!

0 Likes

#3

Just a thought… what shell are you using/have you set your $PATH in?

0 Likes

#4

Sublime Text requires Python 2.6. If you modify your system such that it finds another version instead, then Sublime Text won’t work.

0 Likes

#5

@qeonda because OSX does not execute .profile at standard terminals, IIUC, the PATH should be defined in ~/.bash_profile. In any case, you can checkt if your PATH is correct by tying “echo $PATH” in a terminal.

@michaelcdever: What do you mean by ‘using’? Related to my question/hint above? I have defined the path in .bash_profile, but still have this problem.

@jps: Are you saying, because in a Terminal program that uses a bash shell, wherein I have a PATH environment variable defined that makes a default bash find first the version of Python that I need to work, the whole editor would not work?? I highly doubt that. It would also not find to the point that ST2 brings its own Python interpreter with it, at least it’s written like that in the docs.

I still believe that the behavior is not ‘as planned’, because the docs for build systems say clearly:

As with my PATH, I DO get the right Python that I need to compile the code I have, I get the feeling that ST2 does not look up the PATH variable correctly. Possibly it just checks it’s own PATH variable, which will be different because of the included Python system.

0 Likes

#6

I believe the original poster was attempting to make Sublime Text itself use a different version of Python, rather than anything to do with build systems and running external programs.

0 Likes

#7

I just confirmed, that if I put the absolute path in my build system like this:
{
“cmd”: “/Library/Frameworks/Python.framework/Versions/Current/bin/python”, “-u”, “$file”],
“file_regex”: “^ ]File "(…?)”, line ([0-9]*)",
“selector”: “source.python”
}
then ST2 finds everything and all works as it should. As I said, this looks like it’s a problem with either providing the right PATH TO ST2 (is that possible? I’m a ST2 newbie) or with ST2 looking up the PATH correctly.

@jps I don’t think so, as it’s case /sounds/ rather like mine, (s)he just didn’t express it very precise, as I’m sure the poster did not change the system Python to be the Enthought Python and I interpret

as that you realize that Sublime is using the system python, easily checkable like this

import sys;print sys.version

even so when you just call ‘python’ in a Terminal you get a different output, because, as I believe, something is wrong with the PATH lookup.

0 Likes

#8

Bump! How to find & modify what PATH or profile sublime is running with on OSX? I’m running into a similar problem with the Sublime Ant build not finding compass even though running the ant build.xml from my standard terminal does :ugeek:

0 Likes