Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #28778 > unrolled thread
| Started by | BobAalsma <overhaalsgang_24_bob@me.com> |
|---|---|
| First post | 2012-09-09 07:28 -0700 |
| Last post | 2012-09-11 08:26 -0400 |
| Articles | 13 — 9 participants |
Back to article view | Back to comp.lang.python
Newbie: where's the new python gone? BobAalsma <overhaalsgang_24_bob@me.com> - 2012-09-09 07:28 -0700
Re: Newbie: where's the new python gone? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-09 14:50 +0000
Re: Newbie: where's the new python gone? BobAalsma <overhaalsgang_24_bob@me.com> - 2012-09-09 08:36 -0700
Re: Newbie: where's the new python gone? Ned Deily <nad@acm.org> - 2012-09-09 10:41 -0700
Re: Newbie: where's the new python gone? Ben Finney <ben+python@benfinney.id.au> - 2012-09-10 01:50 +1000
Re: Newbie: where's the new python gone? Hans Mulder <hansmu@xs4all.nl> - 2012-09-09 19:44 +0200
Re: Newbie: where's the new python gone? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-10 07:54 +0100
Re: Newbie: where's the new python gone? Benjamin Kaplan <benjamin.kaplan@case.edu> - 2012-09-09 23:57 -0700
Re: Newbie: where's the new python gone? "William R. Wing (Bill Wing)" <wrw@mac.com> - 2012-09-10 09:04 -0400
Re: Newbie: where's the new python gone? Hans Mulder <hansmu@xs4all.nl> - 2012-09-10 17:22 +0200
Re: Newbie: where's the new python gone? "William R. Wing (Bill Wing)" <wrw@mac.com> - 2012-09-10 16:53 -0400
Re: Newbie: where's the new python gone? Bob Aalsma <overhaalsgang_24_bob@me.com> - 2012-09-11 09:52 +0200
Re: Newbie: where's the new python gone? "William R. Wing (Bill Wing)" <wrw@mac.com> - 2012-09-11 08:26 -0400
| From | BobAalsma <overhaalsgang_24_bob@me.com> |
|---|---|
| Date | 2012-09-09 07:28 -0700 |
| Subject | Newbie: where's the new python gone? |
| Message-ID | <cdb1cefb-77fb-401a-966f-3d84ae3aca38@googlegroups.com> |
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.
[toc] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2012-09-09 14:50 +0000 |
| Message-ID | <504cacae$0$29981$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #28778 |
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. -- Steven
[toc] | [prev] | [next] | [standalone]
| From | BobAalsma <overhaalsgang_24_bob@me.com> |
|---|---|
| Date | 2012-09-09 08:36 -0700 |
| Message-ID | <9fcf4eb6-1ea3-4f75-bf2a-031b754a2c89@googlegroups.com> |
| In reply to | #28778 |
Op zondag 9 september 2012 16:28:55 UTC+2 schreef BobAalsma het volgende: > 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)"
[toc] | [prev] | [next] | [standalone]
| From | Ned Deily <nad@acm.org> |
|---|---|
| Date | 2012-09-09 10:41 -0700 |
| Message-ID | <mailman.423.1347212499.27098.python-list@python.org> |
| In reply to | #28783 |
In article <9fcf4eb6-1ea3-4f75-bf2a-031b754a2c89@googlegroups.com>, BobAalsma <overhaalsgang_24_bob@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. -- Ned Deily, nad@acm.org
[toc] | [prev] | [next] | [standalone]
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Date | 2012-09-10 01:50 +1000 |
| Message-ID | <87ligjqjpq.fsf@benfinney.id.au> |
| In reply to | #28778 |
BobAalsma <overhaalsgang_24_bob@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
[toc] | [prev] | [next] | [standalone]
| From | Hans Mulder <hansmu@xs4all.nl> |
|---|---|
| Date | 2012-09-09 19:44 +0200 |
| Message-ID | <504cd574$0$6990$e4fe514c@news2.news.xs4all.nl> |
| In reply to | #28778 |
On 9/09/12 16:28:55, 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) ". 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. Hope this helps, -- HansM
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2012-09-10 07:54 +0100 |
| Message-ID | <mailman.433.1347260097.27098.python-list@python.org> |
| In reply to | #28790 |
On 10/09/2012 07:10, Dwight Hutto wrote: > I have several installations on my windows, so I use > c:\python27_64\python.exe module_file.py > > or > > c:\python26\python.exe module_file.py > > in the command line. > > > Not to show that this shouldn't be a discussion, but usually it's > searching. Here's search term a link, and some python docs: > > install python windows command line > > or click: > > https://www.google.com/search?q=install+python+windows+command+line&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-ahere's > > and one of the better results: > > http://docs.python.org/faq/windows.html#how-do-i-run-a-python-program-under-windows > > > > Why have you posted this seeing that the OP stated that they're on Mac OS X? The windows faq is outdated wrt PEP397. An up to date version is available here http://docs.python.org/dev/using/windows.html -- Cheers. Mark Lawrence.
[toc] | [prev] | [next] | [standalone]
| From | Benjamin Kaplan <benjamin.kaplan@case.edu> |
|---|---|
| Date | 2012-09-09 23:57 -0700 |
| Message-ID | <mailman.436.1347260226.27098.python-list@python.org> |
| In reply to | #28790 |
On Sun, Sep 9, 2012 at 11:10 PM, Dwight Hutto <dwightdhutto@gmail.com> wrote: > > I have several installations on my windows, so I use > c:\python27_64\python.exe module_file.py > > or > > c:\python26\python.exe module_file.py > > in the command line. > > > Not to show that this shouldn't be a discussion, but usually it's searching. > Here's search term a link, and some python docs: > > install python windows command line > > or click: > > https://www.google.com/search?q=install+python+windows+command+line&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-ahere's > > and one of the better results: > > http://docs.python.org/faq/windows.html#how-do-i-run-a-python-program-under-windows > > > -- > Best Regards, > David Hutto > CEO: http://www.hitwebdevelopment.com > The problem is related to Python on Mac, not on Windows. As was stated in the original post.
[toc] | [prev] | [next] | [standalone]
| From | "William R. Wing (Bill Wing)" <wrw@mac.com> |
|---|---|
| Date | 2012-09-10 09:04 -0400 |
| Message-ID | <mailman.443.1347285874.27098.python-list@python.org> |
| In reply to | #28778 |
On Sep 9, 2012, at 10:28 AM, BobAalsma <overhaalsgang_24_bob@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
[toc] | [prev] | [next] | [standalone]
| From | Hans Mulder <hansmu@xs4all.nl> |
|---|---|
| Date | 2012-09-10 17:22 +0200 |
| Message-ID | <504e05a4$0$6966$e4fe514c@news2.news.xs4all.nl> |
| In reply to | #28819 |
On 10/09/12 15:04:24, William R. Wing (Bill Wing) wrote:
> On Sep 9, 2012, at 10:28 AM, BobAalsma <overhaalsgang_24_bob@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
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.)
For example:
find / -name python > /tmp/pythons.txt 2> /dev/null
The 2>/dev/null bit throws away warnings about permission problems
and the like.
Alternatively, you can cut down the output like so:
find / -name python -print | grep bin/python
That will only report pythons found in directories named "bin".
On my laptop, that cuts the output down to:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
/opt/local/bin/python
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python
/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python
/System/Library/Frameworks/Python.framework/Versions/2.6/bin/python
/usr/bin/python
/usr/local/bin/python
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.
If you're not sure which shell you have, type
echo $SHELL
at the shell prompt.
> 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.
Hope this helps,
-- HansM
[toc] | [prev] | [next] | [standalone]
| From | "William R. Wing (Bill Wing)" <wrw@mac.com> |
|---|---|
| Date | 2012-09-10 16:53 -0400 |
| Message-ID | <mailman.471.1347313996.27098.python-list@python.org> |
| In reply to | #28778 |
On Sep 10, 2012, at 11:17 AM, Bob Aalsma <overhaalsgang_24_bob@me.com> wrote: > Well, Bill, better late than never - thanks for stepping in. > You are right, my problems are not yet solved ;) As Hans pointed out, you are looking for python, not Python (the frameworks are named Python, the executable is python). Sorry about that. To eliminate the output from TimeMachine (assuming it is using an external drive or a TimeCapsule), add one more option to the find command: $ sudo find -x / -name python -print (or follow his directions for piping to a file). The -x option prevents find from descending into a volume with a different device number from the one you started on. -Bill
[toc] | [prev] | [next] | [standalone]
| From | Bob Aalsma <overhaalsgang_24_bob@me.com> |
|---|---|
| Date | 2012-09-11 09:52 +0200 |
| Message-ID | <mailman.495.1347349972.27098.python-list@python.org> |
| In reply to | #28778 |
[Multipart message — attachments visible in raw view] — view raw
Op 10 Sep 2012, om 22:53 heeft William R. Wing (Bill Wing) het volgende geschreven: > On Sep 10, 2012, at 11:17 AM, Bob Aalsma <overhaalsgang_24_bob@me.com> wrote: > >> Well, Bill, better late than never - thanks for stepping in. >> You are right, my problems are not yet solved ;) > > As Hans pointed out, you are looking for python, not Python (the frameworks are named Python, the executable is python). Sorry about that. > > To eliminate the output from TimeMachine (assuming it is using an external drive or a TimeCapsule), add one more option to the find command: > > $ sudo find -x / -name python -print (or follow his directions for piping to a file). > > The -x option prevents find from descending into a volume with a different device number from the one you started on. > > -Bill >
[toc] | [prev] | [next] | [standalone]
| From | "William R. Wing (Bill Wing)" <wrw@mac.com> |
|---|---|
| Date | 2012-09-11 08:26 -0400 |
| Message-ID | <mailman.504.1347370008.27098.python-list@python.org> |
| In reply to | #28778 |
On Sep 11, 2012, at 3:52 AM, Bob Aalsma <overhaalsgang_24_bob@me.com> wrote: > <c.c> > Op 10 Sep 2012, om 22:53 heeft William R. Wing (Bill Wing) het volgende geschreven: > >> On Sep 10, 2012, at 11:17 AM, Bob Aalsma <overhaalsgang_24_bob@me.com> wrote: >> >>> Well, Bill, better late than never - thanks for stepping in. >>> You are right, my problems are not yet solved ;) >> >> As Hans pointed out, you are looking for python, not Python (the frameworks are named Python, the executable is python). Sorry about that. >> >> To eliminate the output from TimeMachine (assuming it is using an external drive or a TimeCapsule), add one more option to the find command: >> >> $ sudo find -x / -name python -print (or follow his directions for piping to a file). >> >> The -x option prevents find from descending into a volume with a different device number from the one you started on. >> >> -Bill >> > > -- > http://mail.python.org/mailman/listinfo/python-list 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? -Bill
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web