[Tutor] 3.0 on Mac

John Fouhy john at fouhy.net
Fri Jun 12 03:46:38 CEST 2009


2009/6/12 acfleck <acfleck at aol.com>:
> I'm a Python nubie and having trouble with 3.0.1 on Mac (10.4.11). I did a
> default install of MacPython 3.0.1. The IDLE.app works fine, but from a
> Terminal window, the 'python' command still gets me V2.5.3 (the original
> Apple installed version). A 'python3' command is not recognized. I'd like to
> know what I need to change to access V3.0.1 from a Terminal window.

Type 'which python' into a terminal.  That will show you the path to
your executable.

My mac is at home, so this is all from memory, but basically there are
two places for python on macs.  One place is the Apple-supplied
install, which goes in /System/Library (I think).  The other is
pythons you install yourself.  The paths will be something like:

/Library/Frameworks/Python.framework/Versions/2.5/python
/Library/Frameworks/Python.framework/Versions/3.0/python

Finally, there will be a symbolic link:

/Library/Frameworks/Python.framework/Versions/Current ->
/Library/Frameworks/Python.framework/Versions/2.5

'which python' should show you .../Current/python.  So, to change to
version 3.0, you need to remove the symbolic link and put in one to
3.0:

rm /Library/Frameworks/Python.framework/Versions/Current
ln -s /Library/Frameworks/Python.framework/Versions/3.0
/Library/Frameworks/Python.framework/Versions/Current/

HTH!

(and if your paths don't match correctly, do ask more questions if
you're uncertain)

(oh, there is a third source for python: MacPorts.  Are you using macports?)

-- 
John.


More information about the Tutor mailing list