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]
On Sun, 09 Sep 2012 07:28:55 -0700, BobAalsma 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) ".
Did you run "make altinstall"? You should, because it is a bad idea to replace the system Python with a newer (or worse, older) version. You can break things.
> So:
> (1) I can't seem to find where the new software has gone
Just enter "python2.7" instead of "python" and it should work perfectly.
> and (2) can't
> seem to find how to point to this new versoin. I've searched Python.org
You won't find it there *wink*
At the terminal, enter:
which python2.7
which should return the full path to the executable, e.g.:
[steve@ando ~]$ which python2.7
/usr/local/bin/python2.7
My system uses Python 2.4 as the system Python, but I prefer to use Python 2.7 as my default. So I have this command in my .bashrc file:
alias python='python2.7'
which means that *for me*, "python" launches Python 2.7, but when system tools call "python" they still see the version they are expecting.
If your shell is something other than bash, you may need to use a different rc file.
Did any of this make sense to you? If anything was unclear, please don't hesitate to ask.
> 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.
Thanks Steven!
Most of what you wrote made very good sense, yes.
Umm, I didn't usa altinstall - should I (and can I) go back? [In hindsight I do like your solution to the versopns a lot more, yes]
Umm2, as said, I think I've installed (at least downloaded) 2.7.3 (note the three there) and with "python2.7" I now see "Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)"
BobAalsma <overhaalsgang_24_...@me.com> writes:
> 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) ".
I think you might have made a mistake.
Without more detail about what you did – detail which you perhaps can't
provide, since it's like asking “where did you last see the thing you
lost” – there's not much more we can do but guess.
You could try following the install instructions again, paying careful
attention to what might go wrong. Either something will go wrong, and
you'll be paying close enough attention to report it; or nothing will go
wrong, and you'll be able to use the version you want.
Good hunting.
-- \ “The most dangerous man to any government is the man who is |
`\ able to think things out for himself, without regard to the |
_o__) prevailing superstitions and taboos.” —Henry L. Mencken |
Ben Finney
In article <9fcf4eb6-1ea3-4f75-bf2a-031b754a2c89@googlegroups.com>,
BobAalsma <overhaalsgang_24_...@me.com> wrote:
> Umm2, as said, I think I've installed (at least downloaded) 2.7.3 (note the > three there) and with "python2.7" I now see "Python 2.7.1 (r271:86832, Jun 16 > 2011, 16:59:05)"
Did you use a binary installer from python.org or did you build it yourself from source? In the former case, you should find the newer python2.7 at /usr/local/bin/python2.7. Also, the installer by default should have added the framework bin directory to your shell PATH. Try opening a new terminal window and typing python2.7. In any case, as suggested:
which python
should tell you the path to the python you are invoking. It doesn't appear to be an Apple-supplied one or a python.org one, BTW.
> 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) ".
Was that a freshly opened Terminal window, or one that was open
before the install?
The installers from python.org by default modify
your .bashrc file to put
/Library/Frameworks/Python.framework/Versions/2.7/bin
at the front of your shell's search path.
However, that only affects windows opened after the install
(unless you use "source ~/.bashrc" to read the new setting
into a pre-existing window).
What happens if you type:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python ?
> 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]
I'm on MacOS 10.5.0, and my default Python is
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
If yours isn't, you could try looking in finder at the
disk you installed Python to, and see if it has a top-level
folder named "Library", containing "Frameworks", etc.
If you find a "Python.framework" under /System/Library
that's the one that ships with MacOS.
On Sep 9, 2012, at 10:28 AM, BobAalsma <overhaalsgang_24_...@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]
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.
On 10/09/12 15:04:24, William R. Wing (Bill Wing) wrote:
> On Sep 9, 2012, at 10:28 AM, BobAalsma <overhaalsgang_24_...@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]
> 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
Trouble is, the file you're looking for is named "python" and this
command is case-sensitive. So the command you need would be:
sudo find / -name python -print
> and will ask for your admin password so it can search in directories
> owned by root.
The file you're looking for is in a directory that you can read
with more mundane permissions, so you might want to leave off
the "sudo" prefix. If you do, you'll get some message about
permission problems.
> (It may also generate quite a bit of output, so you might want
> to capture it in a file.)
Those are all valid python interpreters, or wrappers for same.
> 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.
I doubt it. What files are used, depends on which shell you use.
Bash uses .profile; the C shell uses .login and .cshrc.
I don't think there is a shell that can read both .login and .profile
since .login typically uses C shell syntax and .profile uses Bourne
shell syntax.
> 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 original 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.
+1
> 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.
Well, clearly, the only copies of python 2.7 on your system are from Apple (in System/Library and associated with Xcode).
So, either the one you downloaded overwrote one of them, or the install failed and you didn't notice the error go zooming by in a listing.
Can you run the install procedure again and capture the output?