Home Download Buy Blog Forum Support

Selecting Which Python Version Runs

Selecting Which Python Version Runs

Postby queonda on Wed May 11, 2011 4:32 am

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 -- http://www.enthought.com
Code: Select all
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
Code: Select all
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?
queonda
 
Posts: 15
Joined: Thu May 05, 2011 4:05 pm

Re: Selecting Which Python Version Runs

Postby guillermooo on Wed May 11, 2011 5:32 am

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.
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: Selecting Which Python Version Runs

Postby whololo on Fri Sep 16, 2011 9:23 am

I also have problem with this. How to fix?
whololo
 
Posts: 12
Joined: Fri Jul 08, 2011 10:47 am

Re: Selecting Which Python Version Runs

Postby michaelaye on Tue Dec 13, 2011 5:29 pm

Bump!
michaelaye
 
Posts: 12
Joined: Tue Dec 13, 2011 5:28 pm

Re: Selecting Which Python Version Runs

Postby michaelaye on Thu Dec 15, 2011 8:42 am

guillermooo wrote: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.

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?
michaelaye
 
Posts: 12
Joined: Tue Dec 13, 2011 5:28 pm

Re: Selecting Which Python Version Runs

Postby guillermooo on Thu Dec 15, 2011 9:51 am

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.)
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: Selecting Which Python Version Runs

Postby jps on Thu Dec 15, 2011 9:53 am

jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Selecting Which Python Version Runs

Postby michaelaye on Thu Dec 15, 2011 2:40 pm

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. :(
michaelaye
 
Posts: 12
Joined: Tue Dec 13, 2011 5:28 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 8 guests