2

Terminal is still showing Python 2.7.2 after an install of 3.3.0

I'm new to python- just want to get a good development environment working on Mac 10.8.

Victor Zakharov
  • 24,856
  • 17
  • 77
  • 143
rob-gordon
  • 1,219
  • 2
  • 16
  • 34

3 Answers3

9

Use python3 instead of python:

$ python3
Python 3.2.3 (default, Oct 19 2012, 19:53:57) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Ashwini Chaudhary
  • 232,417
  • 55
  • 437
  • 487
  • thank you. i'll accept when SO lets me in 12 minutes :) cheers – rob-gordon Mar 08 '13 at 00:11
  • If you're new then I would suggest you to use [IPython](http://ipython.org/), it provides some additional features compared to normal python shell. – Ashwini Chaudhary Mar 08 '13 at 00:16
  • i'm doing some looking around, would you also recommending using pip for installing modules or should i try to use macports. i'm a front-end web developer so this is all a new world for me – rob-gordon Mar 08 '13 at 00:18
  • I am not a mac user, so can't say anything about that. This might help: http://stackoverflow.com/questions/1213690/what-is-the-most-compatible-way-to-install-python-modules-on-a-mac – Ashwini Chaudhary Mar 08 '13 at 00:23
5

See PEP 394:

This PEP provides a convention to ensure that Python scripts can continue to be portable across *nix systems, regardless of the default version of the Python interpreter (i.e. the version invoked by the python command).

  • python2 will refer to some version of Python 2.x
  • python3 will refer to some version of Python 3.x
  • python should refer to the same target as python2 but may refer to python3 on some bleeding edge distributions

You have Python 2 and Python 3 installed, so the python command refers to python2. If you want Python 3, do it explicitly with the python3 command.

Community
  • 1
  • 1
Brendan Long
  • 51,248
  • 19
  • 139
  • 179
0

You have few options

  1. In your bash ~/.bash_profile add alias python='python3'
  2. Instead of using python command use python3 instead.
  3. Install python3 via homebrew
cherankrish
  • 1,874
  • 1
  • 15
  • 10