Joon. P Joon. P - 3 months ago 20
Python Question

terminal runs python 2.7 when I have python 3.5 installed on mac.

I was installing, uninstalling and reinstalling pythons on my mac,
and I think things are screwed up a little.

At first by default, terminal ran Python 3.5 when I typed

$python


, but after doing some things, it installed 2.7 and now the terminal runs python 2.7 instead of 3.5

I installed python 3.5 form http://python.org/.

When I open up bash_profile

$vim ~/.bash_profile


This is what shows up

# virtualenv
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh


# Setting PATH for Python 3.5
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH


Now when I type:

$ python


This shows up:

Python 2.7.11 (default, Jun 23 2016, 17:25:20)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>


How can I reset all the python stuff(remove older versions, etc) to the factory version that i had when I first bought Mac(python3.5)?

Answer

This worked for me:

Python 3.x

python3

Python 2.x

python

in terminal