Sublime Forum

Python build configuration

#1

I upgraded my python installation. Basically moved from /System/Library to /Library to do away with OSX SIP. I installed python from python.org using their pkg. The path gets all set up and I see latest the intended version of python through command line (when I use ‘python’ command).

As sublime build configuration uses something like “cmd”: [“python”, “-u”, “$file”] I was assuming that it will pick up the python from pat, but it didn’t and was still pointing to other python.

I could have updated the python to the absolute path and it would have worked. But this seems to be an issue to me. I am assuming this would have to do with the version of python that Sublime sees in its path rather than the one which the user sees.

I removed the sublime and installed Sublime 3 (assuming similar behavior with Sublime 2 as well) and now the correct python is being picked.

Can someone help me to understand the behavior please.

Thanks

0 Likes

#2

If you open terminal, and typed python which version does it open? thats basically what sublime is doing.

0 Likes

#3
The path gets all set up and I see latest the intended version of python through command line (when I use 'python' command).

Hey, I tried my best to put all relevant information in the question.

0 Likes

#4

Sorry i missed that line when I read the question, long day…
Are you using any intermediary package that may change the build behavior? For example Anaconda has a separate build file than just Sublime-python.
you can try opening the sublime debugger (windows its ctrl+tilde ) and seeing what path its using

0 Likes

#5

Not necessarily. On OS X, the PATH environment variable doesn’t necessarily have the same value in the command line shell as it does in GUI apps (which inherit an environment set up by launchd). This has been discussed a few times before. Unfortunately, the way to set up the environment for GUI apps keeps changing in different OS X versions. I’ve had some success in the past using the launchctl setenv command.

You may also find this StackExchange discussion useful: http://stackoverflow.com/questions/25385934/setting-environment-variables-via-launchd-conf-no-longer-works-in-os-x-yosemite

2 Likes