John
John

Reputation: 41

Downloaded Python 3.6 but terminal is still saying I'm using python 2.7.12

I have looked for Python 2.7.12 in my apps and docs but I can't find it... I'm using a macbook pro.
I can see Python 3.6 in my applications so I don't know why the terminal isn't referring to this one.

I want to get started learning django but I don't think it will be possible if I don't use Python 3.5 or later.

is there a way to tell the terminal to use 3.6 instead?

Upvotes: 0

Views: 2768

Answers (4)

ShivaGaire
ShivaGaire

Reputation: 2841

Open the text editor like nano , vim or gedit and open the .bashrc file ,

nano ~/.bashrc

and create the bash alias,

To do so add the following line into the .bashrc file:

alias python='/usr/bin/python3.6'

Save the file and re-open the terminal.

Edit:

Similarly, if you don't want to create the direct alias.

As @exprator suggested above you can also use python command for python 2 and python3 to use Python 3 version

Upvotes: 1

Ezequiel Salas
Ezequiel Salas

Reputation: 59

By the way, you shouldn't use the default environment to develop. Instead, you have to use Virtualenv

Upvotes: 0

Exprator
Exprator

Reputation: 27533

Just use python in terminal for python 2.7 and type python3 to use python 3.6 when you need

Upvotes: 1

Gowtham Balusamy
Gowtham Balusamy

Reputation: 752

  1. . ~/.bashrc
  2. alias python='/usr/bin/python3.4'

Upvotes: 0

Related Questions