Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get ready using python 3.X on Mac?

I download the python 3.2 on OS X, and I installed in my harddisk. But the problem is , when I go to terminal, I type python... It still shows the old version like this:

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

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

Update Shell Profile.command

So, I run it, it display something like that

/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't get the python 3.2 in my terminal. Did I do something wrong? Thanks.

like image 894
DNB5brims Avatar asked Oct 30 '11 10:10

DNB5brims


1 Answers

in your terminal, type python3.

on unix like system, python 2.x is generally the default python version for use by the system. but the language syntax has drastically changed between python 2 and python 3, making the 2 incompatible. thus, you cannot replace python 2 by python 3 on your system or you may completely break some essential systems packages.

so the python 3 interpreter is made available through the python3 command to make the distinction with the old python 2 interpreter.

like image 93
Adrien Plisson Avatar answered Oct 22 '22 04:10

Adrien Plisson