rob-gordon
rob-gordon

Reputation: 1488

Installed Python from Package, Terminal didn't update?

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.

Upvotes: 2

Views: 3143

Answers (3)

cherankrish
cherankrish

Reputation: 2120

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

Upvotes: 0

Brendan Long
Brendan Long

Reputation: 54312

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.

Upvotes: 5

Ashwini Chaudhary
Ashwini Chaudhary

Reputation: 251146

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.

Upvotes: 9

Related Questions