mac install

Gnarlodious gnarlodious at gmail.com
Tue Feb 9 13:51:09 EST 2010


Hello. The answer is, I don't know. But I originally replaced my
existing Python with 3.1.1. I then had to backtrack because some stuff
broke. Nothing in the OS, but adapting every Python script on my HD
was not what I wanted to do.

So my Py3 executable is at:
/Library/Frameworks/Python.framework/Versions/3.1/bin/python3.1
then symlink to that in folder:
/usr/local/bin

using command:
sudo ln -s /Library/Frameworks/Python.framework/Versions/3.1/bin/
python3.1 /usr/local/bin/python3.1

so that saying:
ls /usr/local/bin

shows the link to the Py3 folder as:
python3.1 -> /Library/Frameworks/Python.framework/Versions/3.1/bin/
python3.1

Now your existing scripts still work on Py 2.6. New scripts invoke Py3
like this:
#!/usr/local/bin/python3.1

For Terminal sessions, an alias in your bash_profile puts you in Py3
by default without nasty surprises:
alias python=/usr/local/bin/python3.1

You can also create a file at:
/Library/Python/3.1/site-packages/sitecustomize.py

with a configuration that runs at loadtime, although some things seem
to fail. But all in all this system has worked well for me (including
CGI) and should be easy to go mainstream once Apple goes to Py3.

-- Gnarlie




More information about the Python-list mailing list