How do I change my PYTHONPATH to make 3,2 my default Python instead of 2.7.2?

It's not good to change the default python. Many system programs depends on python2 not python3. if you want to use python3, you just type the command python3.


The PYTHONPATH doesn't have much to do with it. It just tells the Python interpreter, whichever interpreter runs, where to find extra modules you want to load.

But either way, changing the default version on your system is dangerous, as other commenters have observed. You stand the risk of breaking existing package that are built against Python2 and use /usr/bin/env python to find their interpreters.

In fact, that's the wrong way to phrase it. Changing the default version of Python will break your entire Ubuntu system and cause lots of programs to just not work. It's also completely unnecessary.

But since you asked, you just do this:

sudo rm /usr/bin/python
sudo ln -s /usr/bin/python3.2mu /usr/bin/python

Happy crashing!


I added this in my .bashrc, its working fine so far:

alias python='python3'