Sublime Forum

Selecting Which Python Version Runs

#1

My Mac OSX system has several python installations. When I run python from Textmate or from Terminal, I get the following version:

Enthought Python Distribution – enthought.com

Version: 7.0-2 (32-bit) Python 2.7.1 |EPD 7.0-2 (32-bit)| (r271:86832, Dec 3 2010, 15:41:32) [GCC 4.0.1 (Apple Inc. build 5488)] on darwin

This is what gets run from Sublime’s build system

2.6.1 (r261:67515, Jun 24 2010, 21:47:49) [GCC 4.2.1 (Apple Inc. build 5646)]

What is the appropriate way to get Sublime to use the correct (or Current) version? The build system file only has a call to python, which should default to the Enthought Python Distribution. What could be going on here?

0 Likes

#2

Have you tried to “which python” in Terminal and see whether that path to python is added to PATH in your profile? I don’t use Macs, but I suppose there’s a way to set environment variables system-wide too? There may be different values in both places.

0 Likes

#3

I also have problem with this. How to fix?

0 Likes

#4

Bump!

0 Likes

#5

But why would ST2 look up a system ENV? I would like it to respect MY env. variables, isn’t that what it should do?

0 Likes

#6

I’m not sure, but I think it works like you say on Windows. (I nearly always start ST from the cmdline, so I would have to doublecheck which PATH is read from the Windows shell.)

0 Likes

#7

See stackoverflow.com/questions/1356 … es-in-os-x

0 Likes

#8

oh, i remember now, sorry. I have this problem so rarely, I forgot about it. On OSX there is this weird thing that graphical apps have an extra way to receive the env. variables.
Hm, I’m not much in the business on OS-software, just science-related analysis software.
What I would do there is, to ask via a Python command what the name of the current user is and fetch his .bash_profile and read out her PATH definition. But that would fail at a definition referring to an existing value of the PATH variable. Can one not launch a shell in the name of the current user and retrieve the value PATH is set to?
It’s so weird that this stuff is hard to do on a Unix-based machine. :frowning:

0 Likes