Newbie: where's the new python gone?

William R. Wing (Bill Wing) wrw at mac.com
Mon Sep 10 09:04:24 EDT 2012


On Sep 9, 2012, at 10:28 AM, BobAalsma <overhaalsgang_24_bob at me.com> wrote:

> I think I've installed Python 2.7.3 according to the instructions in the README, and now want to use that version. 
> However, when typing "python" in Terminal, I get "Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32) ".
> So:
> (1) I can't seem to find where the new software has gone and 
> (2) can't seem to find how to point to this new versoin.
> I've searched Python.org and with Google but :(
> [I'm on Mac OS X 10.7.4]
> 
> Please help.
> -- 
> http://mail.python.org/mailman/listinfo/python-list

Bob, I'm coming into this late, but it doesn't appear that you've gotten a satisfactory answer yet.  Let's take it one step at a time.

First, if none of the hints you've received earlier have gotten you going.  Maybe the thing is to resort to a bigger hammer.  In a terminal window:

$sudo find / -name Python -print<return>

This will search the entire file system for all the files named Python and will ask for your admin password so it can search in directories owned by root.  (It may also generate quite a bit of output, so you might want to capture it in a file.)  In any case, this will take several minutes and while it is running, you can be checking a couple of other things.  OS X doesn't use a .bashrc file by default (you can make it do so if you want, but that's extra work right now).  It uses .login and then .profile to set up your python path _if_ you've used the installer from python.org.

So, look to see if you have a .profile in your ~ directory.  If so, then you're using (or have used at some point in the past) an installer from python.org.
It should have an entry that looks something like the following:

# Setting PATH for Python 2.7
# The orginal version is saved in .profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

Note the distinction between this path and the one from Apple.  The python that ships from Apple is in /System/Library/Frameworks…

Do NOT touch the one from Apple.  Apple uses it for some of its housekeeping operations and you want it to stay just as Apple installed it.

When you finally find the Python 2.7 in the output from the "find" command, you can edit your .login (if you don't have a .profile) or edit .profile if you do.

Good luck,
Bill




More information about the Python-list mailing list