Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bash alias --> Python 2.7 to Python 3.3

I am trying to make Python 3.4.2 the default in Linux (currently it is 2.7.6). I am not very knowledgeable on this stuff, but I have read in several places online that you can simply put an alias in the ~/.bashrc or ~/.bash_aliases file like this:

alias python='python3'

I don't have either the ~/.bashrc or ~/.bash_aliases file . . . I am assuming you can just create them. I have done that, but the alias doesn't seem to be working. Am I missing something? Do you need the shebang at the beginning of the file? I have tried it both ways.

Thanks for any help you can give!

like image 563
laurenll Avatar asked Jan 05 '15 23:01

laurenll


1 Answers

DON'T DO IT!

Some linux utilities depend on python2.x currently. It will probably break your system if you make that change since python3.x is not backward compatible with python2.x. Unless you are fully aware of the consequences, don't do it!

Similar question is asked here : https://askubuntu.com/questions/103469/how-do-i-change-my-pythonpath-to-make-3-2-my-default-python-instead-of-2-7-2

like image 143
Seçkin Savaşçı Avatar answered Sep 19 '22 02:09

Seçkin Savaşçı