classification
Title: Mac Python 3.1 installer does less than earlier installers
Type: enhancement Stage: resolved
Components: Installation Versions: Python 3.1
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: Bruce.Sherwood, eric.araujo, ned.deily, r.david.murray, ronaldoussoren
Priority: normal Keywords:

Created on 2010-10-27 20:38 by Bruce.Sherwood, last changed 2010-11-03 04:24 by Bruce.Sherwood. This issue is now closed.

Messages (9)
msg119731 - (view) Author: Bruce Sherwood (Bruce.Sherwood) Date: 2010-10-27 20:38
For Python 2.x on Macs, the installer added PATH code to .profile and switched /Library/Framework/Python.framework/Versions/Current to point to the newly installed version of Python. Neither of these actions is carried out by the 3.1.2 installer, and I wonder whether this is intentional or an oversight. Also, it's not clear to me what command one could issue in a terminal to execute the new Python (you can of course start the new Python from the Applications folder).
msg119740 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-10-27 21:20
Yes this is deliberate.  On linux, 'python' is Python2, and 'python3' is Python3.  I'm not a mac user, so I don't know exactly how the naming conventions work there, but I certainly wouldn't expect the 'current version' of 'python' to change to python3.  I think perhaps the command name you use from the terminal is the same as it is on linux: python3, but I'm not positive.
msg120250 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-02 19:44
Does 3.2 install into a Python3.framework?  In other words, is the conception that 2.x and 3.x are two different languages ported over to Mac?
msg120251 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-02 19:45
Without typos: Does 3.1 install into a Python3.framework directory?
msg120274 - (view) Author: Bruce Sherwood (Bruce.Sherwood) Date: 2010-11-02 22:44
Yes. After installation, you'll see that Python 3.1 is in
/Library/Frameworks/Python.framework/Versions/3.1

Bruce Sherwood

On Tue, Nov 2, 2010 at 1:45 PM, Éric Araujo <report@bugs.python.org> wrote:
>
> Éric Araujo <merwok@netwok.org> added the comment:
>
> Without typos: Does 3.1 install into a Python3.framework directory?
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue10215>
> _______________________________________
>
msg120288 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-02 23:20
So your answer is actually *no*, it does not install into Python3.framework :)

If there had been separate Python.framework and Python3.framework, the answer to this bug would be obvious.  But since 2.x and 3.x Pythons are installed as versions of the same framework, it sort of makes sense that Versions/Current can point to a 3.x version.

Do I make sense?
msg120296 - (view) Author: Bruce Sherwood (Bruce.Sherwood) Date: 2010-11-03 00:57
Now I understand what you're getting at; I didn't realize that you were aiming at the possible distinction between 3 and 3.1. Yes, this is what bothered me and prompted my original posting. Python 3.1 goes into the same framework as the 2.x versions.

Incidentally, I did find that in /usr/local/bin (where I had not thought to look) there are the following:

python3.1, a link to the framework python3.1
pythonw3.1, a link to the framework pythonw3.1

python3, a link to a framework python3, which is an extra copy (not a link) to the framework python3.1
pythonw3, a link to a framework pythonw3, which is a link to the framework python3.1

This looks to me pretty contorted, although I suppose the goal was to let people either run "python" (their most recent Python 2.x) or run "python3" (their most recent Python 3.x).

A somewhat related example of confusion is that on Ubuntu 10.10 there is a shadowy existence for some python3 that has its own lib folder, in parallel to python3.1; the python3 doesn't seem to be simply an alias for python3.1.
msg120304 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-11-03 02:41
It was a deliberate decision on Ronald's part to not modify the Versions/Current link in the Python framework when installing a Python 3.x version.  As far as I know, the Current link is not used anywhere other than perhaps by Xcode when trying to link a Python frameworks into another language project.  Current has no affect on any of the /usr/local symlinks optionally created by the python OS X installer.

Use of the those symlinks is somewhat problematic anyway once you install any third-party packages that include scripts.  By default, Distutils installs scripts into the framework bin directory of the appropriate version.  That's why the recommended approach to managing paths is to simply put the framework bin directory towards the head of your shell PATH, so something like:

export PATH="/Library/Frameworks/Python.framework/Versions/3.1/bin:${PATH}"

For each version, the OS X installer provides "Update Shell Profile.command" to alter the most common shell profiles accordingly; it can be found in the "/Applications/Python x.m" folder.  As documented in the installer README, for 3.x installs, the installer does not automatically run "Update Shell Profile" as it does for 2.x installs; you need to run it explicitly or otherwise cause PATH to be changed.
msg120307 - (view) Author: Bruce Sherwood (Bruce.Sherwood) Date: 2010-11-03 04:24
Thanks for the detailed explanation. What had not occurred to me was to read the README file that came with the installer. I made the mistake (that may be made by others) of assuming continuity with installer policy, especially since the installation location was the same as before.
History
Date User Action Args
2010-11-03 04:24:00Bruce.Sherwoodsetmessages: + msg120307
2010-11-03 02:41:32ned.deilysetmessages: - msg120303
2010-11-03 02:41:22ned.deilysetmessages: + msg120304
2010-11-03 02:37:26ned.deilysetnosy: + ned.deily
messages: + msg120303
2010-11-03 00:57:01Bruce.Sherwoodsetmessages: + msg120296
2010-11-02 23:20:52eric.araujosetmessages: + msg120288
2010-11-02 22:44:44Bruce.Sherwoodsetmessages: + msg120274
2010-11-02 19:45:26eric.araujosetmessages: + msg120251
2010-11-02 19:44:37eric.araujosetnosy: + eric.araujo
messages: + msg120250
2010-10-27 21:24:06r.david.murraysetstatus: open -> closed
resolution: not a bug
stage: resolved
2010-10-27 21:20:53r.david.murraysetnosy: + r.david.murray
messages: + msg119740
2010-10-27 21:11:48pitrousetassignee: ronaldoussoren

nosy: + ronaldoussoren
2010-10-27 20:38:10Bruce.Sherwoodcreate