How to update Python on a Mac with Unix commands
After giving up on doing a disk partition and getting Linux, I decided to try and install Python 3.3.2 on a 32 bit Intel Core 2 Duo iMac with OS X 10.6.8 Snow Leopard. I did pretty much everything the official website says, but it isn't working at all.
First of all, I downloaded the installer for Mac OS X 6 and later, which should supposedly put a folder called MacPython 3.3 with IDLE, PythonLauncher and a Build Applet tool in my Applications folder. What I have instead is a folder called Python 3.3 which does contain (aside from the documentation and a command to update shell profile) IDLE and PythonLauncher, but no Build Applet tool; I typed 'python' into my Terminal window to see if 3.3.2 was installed, but it said Python 2.6.1 even after restarting my computer. The ReadMe in the disk image that contains the installer says running the installer should also 'put the underlying machinery into the folder /Library/Frameworks/Python.framework'. I did every search imaginable and apparently there is no such folder anywhere in my hard drive.
Basically, I want to install 3.3.2 and run things in programme mode rather than shell mode, which I find to be a huge pain in the bottom. Any help is greatly appreciated.
EDIT: found the Frameworks folder. Python.framework contains 4 folders named 2.3, 2.5, 2.6 and Current, which has several other folders inside – all for Python 2.6. The official page says I shouldn't delete any of them because they already come with Mac. How do I put 3.3 here?
So your Mac is still looking for an old version of Python. You need to inform it that there is in fact a new version and where it can find it. To do this, you need to update the PATH
to Python.
This can be done in your .bash_profile
file.
# Setting PATH for Python 3.3.2.
# The original version is saved in .profile.pysave.
PATH="/Library/Frameworks/Python.framework/Versions/3.3.2/bin:${PATH}"
export PATH
After you update the .bash_profile
file Terminal should run the new version of Python, when you ask for it.