How to prepare using python 3.X on Mac?

I download python 3.2 on OS X and I installed it on my hard drive. But the problem is that when I go to the terminal, I type python ... It still shows the old version as follows:

Python 2.6.1 (r261: 67515, June 24, 2010 9:47:49 p.m.) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Enter "help", "copyright", "credits" or "license "for more information.

Then I go to the folder under the python, I find a file like this:

Update Profile.command Shell

So, I run it, it shows something like this

 /Applications/Python\ 3.2/Update\ Shell\ Profile.command ; exit; Users-MacBook:~ User$ /Applications/Python\ 3.2/Update\ Shell\ Profile.command ; exit; This script will update your shell profile when the 'bin' directory of python is not early enough of the PATH of your shell. These changes will be effective only in shell windows that you open after running this script. All right, you're a python lover already logout [Process compleUser] 

But I still can not get python 3.2 in my terminal. Did I do something wrong? Thank you

+7
source share
1 answer

in your terminal type python3 .

on a unix-like system, python 2.x is usually the default version of python to be used by the system. but the language syntax has changed radically between python 2 and python 3, which makes 2 incompatible. Thus, you cannot replace python 2 with python 3 on your system or completely break some necessary system packages.

therefore, the python 3 interpreter becomes available with the python3 command to make a distinction with the old python 2 interpreter.

+9
source

All Articles