If you see it

Live for passion

Python Upgrade 2.7 to 3.2 on Mac

Well, honestly, this is the note to myself.

Have you ever felt that I should know this and handle it like fast and smooth?

Here is the something: upgrade python 2.7 to 3.2 on Mac(Moutain Lion 10.8.4).

Choices

brew install

1
2
3
4
5
$ brew search python  
gst-python010  python       python24       python25       python26       python3    python31   python32
homebrew/apache/mod_python
$ brew install python32  
Error: Permission denied - /Library/Caches/Homebrew/Formula/python32.brewing

You may counter some fun issues, and I had references here.

HomeBrew Mac os x 10.8 throwing errors “no such file to load”

To know what verison of python you have on your mac except System provide

1
2
$ ls /Library/Frameworks/Python.framework/Versions/  
3.3

Using Python on a Macintosh

python binary from the website

Python 3.3.2 download //Yea, I picked the lastest one here, not 3.2…

And ah, magically, it installed, but when I typed python in iTerm, it still showing 2.7, why??

Here is where/how to get to your python 3.3

1. It’s a app-ish thing in your Applications folder, as IDLE and Python Laucher.
2. Try

1
2
$ python3 
$ python3 test.py

“Interesting” problem

After you install python 3.3, you have both 2.7 and 3.3 pythong versions coexist on your mac, what if you want to use library like httplib2 for your code but only 2.7 has it?

Check the wiki page: httplib2 installation instruction

Basically:

  1. Download the zip file, unzip it
  2. python3 setup.py install

Comments