Have two versions of Python on OSX without overwriting

3

Is there a way to install Python's 3.x version without overwriting the pre-installed (essential) version of OSX?

I already know virtualenv but I'd like to avoid it, because I only use Python to study.

Is there any way to keep both versions parallel and "living in harmony"?

I imagine I could do something like this:

Starting Python 2

MBP:~ jbueno$ python 

Starting Python 3

MBP:~ jbueno$ python3
    
asked by anonymous 20.08.2015 / 00:45

1 answer

3

Just install Homebrew through the terminal (need Xcode installed):

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then just install Python 3 through the command brew :

brew install python3

To run something using Python 3 just use the command python3 instead of only python .

python3 --version
    
20.08.2015 / 02:21